source:
WAeUP_SRP/trunk/skins/waeup_default/sessions_voc.py
@
1747
Last change on this file since 1747 was 1747, checked in by , 18 years ago | |
---|---|
|
|
File size: 401 bytes |
Rev | Line | |
---|---|---|
[1736] | 1 | ##parameters=key=None |
[1728] | 2 | # $Id: sessions_voc.py 1747 2007-05-07 20:56:24Z joachim $ |
3 | """ | |
4 | Return the sessions as an vocabulary | |
5 | ||
6 | """ | |
7 | if key is None: | |
[1747] | 8 | l = [('xx','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 | ||
13 | if len(key) != 2: | |
[1747] | 14 | return 'unknown' |
[1728] | 15 | try: |
16 | y = int(key) | |
17 | except: | |
[1747] | 18 | return 'unknown' |
[1728] | 19 | if y < 90: |
20 | cent = 2000 | |
21 | else: | |
22 | cent = 1900 | |
23 | return "%4d/%4d" % (cent+y, cent+y+1) | |
24 |
Note: See TracBrowser for help on using the repository browser.