[Python-checkins] r55994 - in sandbox/trunk/pep0: NOTES pep0/pep.py

brett.cannon python-checkins at python.org
Fri Jun 15 05:59:41 CEST 2007


Author: brett.cannon
Date: Fri Jun 15 05:59:31 2007
New Revision: 55994

Modified:
   sandbox/trunk/pep0/NOTES
   sandbox/trunk/pep0/pep0/pep.py
Log:
Add code to verify author names.  Leave commented out, though, as there is an
obvious disparity between the author names in the PEPs and those in the index.


Modified: sandbox/trunk/pep0/NOTES
==============================================================================
--- sandbox/trunk/pep0/NOTES	(original)
+++ sandbox/trunk/pep0/NOTES	Fri Jun 15 05:59:31 2007
@@ -5,13 +5,8 @@
 
 * Author/email list.
     + Fix loss of a single space when name contains an accented character.
-    + Column headers.
-        - Underline to length of author name or just column header like in
-          rest of doc?
 
 * Verify PEP is well-formatted.
-    + Values in fields correct.
-        - All authors declared in email list.
     + Formatting correct.
         - Plaintext.
         - reST.
@@ -55,3 +50,5 @@
             - Conflicts with Accepted and Deferred initials, respectively.
             - Worth using other letters?
 
+    * Disparity between author name in PEPs and listed in index.
+        + E.g., "Barry A. Warsaw" and "Warsaw, Barry".

Modified: sandbox/trunk/pep0/pep0/pep.py
==============================================================================
--- sandbox/trunk/pep0/pep0/pep.py	(original)
+++ sandbox/trunk/pep0/pep0/pep.py	Fri Jun 15 05:59:31 2007
@@ -32,6 +32,9 @@
     status_values = ("Accepted", "Rejected", "Withdrawn", "Deferred", "Final",
                      "Active", "Draft")
 
+    # XXX Uncomment to valid author names (along with code in __init__).
+    #valid_authors = set(x[0] for x in constants.email_addresses)
+
     def __init__(self, metadata_dict):
         """Init object based on dict containing metadata from a file.
         
@@ -77,6 +80,10 @@
         self.status = status
         # 'Author'.
         authors = self._parse_author(metadata_dict['Author'])
+        # XXX Uncomment (plus valid_authors) to validate author names.
+        #for author in authors:
+        #    if author not in self.valid_authors:
+        #        raise ValueError("%s is not a valid author name" % author)
         if len(authors) < 1:
             raise ValueError("no authors found (PEP %s)" % self.number)
         self.authors = authors


More information about the Python-checkins mailing list