from . import Name, Graduation, Contact, Bio, Professor
-GRADUATION_REGEXP = re.compile('^(\S*) +(\S*), (\D*) *(\d*)$')
+GRADUATION_REGEXP = re.compile('^(\S*) +(\S*), (\D*)(, *(\d*))?$')
"""Examples:
M.S. Physics, University of Calcutta, Calcutta, India
if prof['position1'] != None:
p.title += ', %s' % prof['position1']
p.graduations = []
- print prof['degrees']
for degree in prof['degrees'].splitlines():
- m = GRADUATION_REGEXP.match(degree)
+ m = GRADUATION_REGEXP.match(degree.strip())
assert m != None, 'Misformed graduation: %s' % degree
- title,field,college,year = m.groups()
+ title,field,college,comma_year,year = m.groups()
if year == '':
year = None
p.graduations.append(
profile=prof['profile'],
cv=None,
)
- self.logger.debug(unicode(p))
+ db.logger.debug(unicode(p))
yield p