From dbab3f6d41f0bce64890aba9cb1b3f1f75d43c73 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 26 Jun 2010 18:00:25 -0400 Subject: [PATCH] Fixes to GRADUATION_REGEXP in export_mysql --- sitecore/prof/export_mysql.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sitecore/prof/export_mysql.py b/sitecore/prof/export_mysql.py index d022716..3fa9e6f 100644 --- a/sitecore/prof/export_mysql.py +++ b/sitecore/prof/export_mysql.py @@ -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, -- 2.26.2