##parameters=key=None # $Id: getSessionsVoc.py 1986 2007-07-05 09:10:38Z henrik $ """ Return the sessions as a vocabulary """ if key is None: # not used for WAeUPSessionWidget, only for SelectWidget l = [('','')] for y in range(1998,2010): l.append( ('%s' % str(y)[-2:],'%4d/%4d' % (y,y+1))) return l try: y = int(key) except: raise KeyError if y == -1: raise KeyError if y < 90: cent = 2000 else: cent = 1900 return "%4d/%4d" % (cent+y, cent+y+1)