Fixes to GRADUATION_REGEXP in export_mysql
authorW. Trevor King <wking@drexel.edu>
Sat, 26 Jun 2010 22:00:25 +0000 (18:00 -0400)
committerW. Trevor King <wking@drexel.edu>
Sat, 26 Jun 2010 22:00:59 +0000 (18:00 -0400)
sitecore/prof/export_mysql.py

index d0227169a9537a3793c4a63e3949e2a55b9c263f..3fa9e6fbfea2fc00a3ef6b2bd153263fddd385ed 100644 (file)
@@ -33,7 +33,7 @@ from .. import get_logger
 from . import Name, Graduation, Contact, Bio, Professor
 
 
-GRADUATION_REGEXP = re.compile('^(\S) +(\S), (.*) *(\d)?$')
+GRADUATION_REGEXP = re.compile('^(\S*) +(\S*), (\D*) *(\d*)$')
 """Examples:
 
 M.S.  Physics, University of Calcutta, Calcutta, India
@@ -178,6 +178,8 @@ Where the relevant categories are
                 m = GRADUATION_REGEXP.match(degree)
                 assert m != None, 'Misformed graduation: %s' % degree
                 title,field,college,year = m.groups()
+                if year == '':
+                    year = None
                 p.graduations.append(
                     Graduation(
                         college=college,