[Python-checkins] r55981 - sandbox/trunk/pep0/pep0/output.py sandbox/trunk/pep0/pep0/pep.py

brett.cannon python-checkins at python.org
Fri Jun 15 04:37:39 CEST 2007


Author: brett.cannon
Date: Fri Jun 15 04:37:37 2007
New Revision: 55981

Modified:
   sandbox/trunk/pep0/pep0/output.py
   sandbox/trunk/pep0/pep0/pep.py
Log:
Move sort_peps to the 'output' module as it is the only user of the function.


Modified: sandbox/trunk/pep0/pep0/output.py
==============================================================================
--- sandbox/trunk/pep0/pep0/output.py	(original)
+++ sandbox/trunk/pep0/pep0/output.py	Fri Jun 15 04:37:37 2007
@@ -1,10 +1,6 @@
-"""Code to handle the output of PEP 0.
-
-XXX
-    * Move PEP sorting to here.
-"""
+"""Code to handle the output of PEP 0."""
 from . import constants
-from .pep import sort_peps, PEP
+from .pep import PEP
 
 from sys import stdout
 
@@ -22,6 +18,35 @@
     print>>output, constants.column_format % underline_headers
 
 
+def sort_peps(peps):
+    """Sort PEPs into meta, informational, accepted, open, finished, empty,
+    and essentially dead."""
+    meta = []
+    info = []
+    accepted = []
+    open_ = []
+    finished = []
+    empty = []
+    dead = []
+    for pep in peps:
+        # Order of 'if' statement important.  Key Status values take precedence
+        # over Type value, and vice-versa.
+        if pep.status == 'Draft':
+            open_.append(pep)
+        elif pep.status in ('Rejected', 'Withdrawn', 'Deferred',
+                'Incomplete'):
+            dead.append(pep)
+        elif pep.status == 'Process':
+            meta.append(pep)
+        elif pep.status == 'Informational':
+            info.append(pep)
+        elif pep.status == 'Accepted':
+            accepted.append(pep)
+        elif pep.status == 'Final':
+            finished.append(pep)
+    return meta, info, accepted, open_, finished, empty, dead
+
+
 def write_pep0(peps, output=stdout):
     print>>output, constants.header
     print>>output

Modified: sandbox/trunk/pep0/pep0/pep.py
==============================================================================
--- sandbox/trunk/pep0/pep0/pep.py	(original)
+++ sandbox/trunk/pep0/pep0/pep.py	Fri Jun 15 04:37:37 2007
@@ -146,34 +146,3 @@
             return ' '.join(name_parts[-2:])
         else:
             return name_parts[-1]
-
-def sort_peps(peps):
-    """Sort PEPs into meta, informational, accepted, open, finished, empty,
-    and essentially dead."""
-    meta = []
-    info = []
-    accepted = []
-    open_ = []
-    finished = []
-    empty = []
-    dead = []
-    for pep in peps:
-        # Order of 'if' statement important.  Key Status values take precedence
-        # over Type value, and vice-versa.
-        if pep.status == 'Draft':
-            open_.append(pep)
-        elif pep.status in ('Rejected', 'Withdrawn', 'Deferred',
-                'Incomplete'):
-            dead.append(pep)
-        elif pep.status == 'Process':
-            meta.append(pep)
-        elif pep.status == 'Informational':
-            info.append(pep)
-        elif pep.status == 'Accepted':
-            accepted.append(pep)
-        elif pep.status == 'Final':
-            finished.append(pep)
-    return meta, info, accepted, open_, finished, empty, dead
-
-
-


More information about the Python-checkins mailing list