source: WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py @ 1739

Last change on this file since 1739 was 1736, checked in by Henrik Bettermann, 18 years ago

key 'unknown' added

  • Property svn:keywords set to Id
File size: 440 bytes
RevLine 
[1736]1##parameters=key=None
[1728]2# $Id: sessions_voc.py 1736 2007-05-04 15:30:11Z henrik $
3"""
4Return the sessions as an vocabulary
5
6"""
7if key is None:
[1736]8    l = [('unknown','unknown')]
[1728]9    for y in range(1998,2008):
10        l.append( ('%s' % str(y)[-2:],'%4d/%4d' % (y,y+1)))
11    return l
12
13if len(key) != 2:
14    return "invalid Session %s" % key
15try:
16    y = int(key)
17except:
18    return "invalid Session %s" % key
19if y < 90:
20    cent = 2000
21else:
22    cent = 1900
23return "%4d/%4d" % (cent+y, cent+y+1)
24
Note: See TracBrowser for help on using the repository browser.