From: W. Trevor King Date: Sat, 26 Jun 2010 22:00:25 +0000 (-0400) Subject: Fixes to GRADUATION_REGEXP in export_mysql X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dbab3f6d41f0bce64890aba9cb1b3f1f75d43c73;p=sitecorepy.git Fixes to GRADUATION_REGEXP in export_mysql --- 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,