[Python-checkins] r54828 - sandbox/trunk/pep0/TODO sandbox/trunk/pep0/pep0.py

brett.cannon python-checkins at python.org
Sun Apr 15 03:35:34 CEST 2007


Author: brett.cannon
Date: Sun Apr 15 03:35:29 2007
New Revision: 54828

Modified:
   sandbox/trunk/pep0/TODO
   sandbox/trunk/pep0/pep0.py
Log:
Flesh out output of static text.


Modified: sandbox/trunk/pep0/TODO
==============================================================================
--- sandbox/trunk/pep0/TODO	(original)
+++ sandbox/trunk/pep0/TODO	Sun Apr 15 03:35:29 2007
@@ -4,11 +4,6 @@
 * Read PEPs as UTF-8.
 
 * Output static text for PEP 0.
-    + Header.
-    + Footer.
-    + Introduction.
-    + References.
-    + Column titles for numerical index.
     + Author/email list.
         - names
         - emails
@@ -16,9 +11,8 @@
             * Underline to length of author name or just column header like in
               rest of doc?
 
-* Output PEP 0 with special sections.
-    + Sort PEPs.
-    + Column headers.
+* Index by Category.
+    + Sort PEPs and output
     + Section info.
 
 * Make sure that it is easy to identify which PEP triggered an error.

Modified: sandbox/trunk/pep0/pep0.py
==============================================================================
--- sandbox/trunk/pep0/pep0.py	(original)
+++ sandbox/trunk/pep0/pep0.py	Sun Apr 15 03:35:29 2007
@@ -36,16 +36,14 @@
         http://www.python.org/doc/essays/pepparade.html
 """
 
-footer = """
-
+footer = """
 Local Variables:
 mode: indented-text
 indent-tabs-mode: nil
 sentence-end-double-space: t
 fill-column: 70
 coding: utf-8
-End:
-"""
+End:"""
 
 
 type_values = ("Standards Track", "Informational", "Process")
@@ -212,6 +210,13 @@
                     (type_abbr, status_abbr, number, title.ljust(44),
                         author_string))
 
+def write_column_headers(output):
+    """Output the column headers for the PEP indices."""
+    output.write('%s  %s %s\n' % ("num".rjust(8), "title".ljust(44), "owner"))
+    output.write('%s  %s %s\n' % ((len("num")*'-').rjust(8),
+                         (len("title")*'-').ljust(44), len("owner")*'-'))
+
+
 
 if __name__ == '__main__':
     from sys import argv, stdout
@@ -225,12 +230,27 @@
     else:
         peps = [consume_pep(path)]
 
-
+    print header
+    print
+    print "Introduction"
+    print intro
+    print
+    print "Index by Category"
+    print
+    write_column_headers(stdout)
     #XXX meta, info, accepted, open_, done, empty, dead = sort_peps(peps)
-
+    print ' XXX'
+    print
+    print
+    print "Numerical Index"
+    print
+    write_column_headers(stdout)
+    prev_pep = 0
     for pep in peps:
+        if pep['PEP'] - prev_pep > 1:
+            print
         write_pep(pep, stdout)
-
+        prev_pep = pep['PEP']
     print
     print
     print "Key"
@@ -251,3 +271,10 @@
     # * find longest name.
     # * column headers.
     # * name/email with a two-space separation between longest name and email.
+    print '    XXX'
+    print
+    print
+    print "References"
+    print
+    print references
+    print footer


More information about the Python-checkins mailing list