[Python-checkins] r54820 - sandbox/trunk/pep0/pep0.py sandbox/trunk/pep0/test_pep0.py (original) (raw)

brett.cannon python-checkins at python.org
Sat Apr 14 02:33:00 CEST 2007


Author: brett.cannon Date: Sat Apr 14 02:32:58 2007 New Revision: 54820

Modified: sandbox/trunk/pep0/pep0.py sandbox/trunk/pep0/test_pep0.py Log: Add support for author nicknames.

Modified: sandbox/trunk/pep0/pep0.py

--- sandbox/trunk/pep0/pep0.py (original) +++ sandbox/trunk/pep0/pep0.py Sat Apr 14 02:32:58 2007 @@ -1,5 +1,6 @@ """Auto-generate PEP 0 (PEP index). """ from future import with_statement +import authors import os import re

@@ -65,7 +66,7 @@ angled = r'(?P.+?) <.+?>' paren = r'.+? ((?P.+?))' simple = r'(?P[^,]+)'

@@ -76,14 +77,15 @@ # separated by commas. author = match.group('author') if not author.partition(' ')[1] and author.endswith('.'):

def handle_csv(data): """Handle the Post-History.""" @@ -94,8 +96,8 @@ 'Post-History': handle_csv, }

-def last_name(full_name):

+def last_name(full_name, nicknames={}):

@@ -103,6 +105,9 @@ comma, then drop the suffix.

 """

if name == 'main':

Modified: sandbox/trunk/pep0/test_pep0.py

--- sandbox/trunk/pep0/test_pep0.py (original) +++ sandbox/trunk/pep0/test_pep0.py Sat Apr 14 02:32:58 2007 @@ -157,6 +157,17 @@ got = pep0.last_name(full_name) self.failUnlessEqual(got, expect)

def test_main(): test_support.run_unittest(



More information about the Python-checkins mailing list