source: WAeUP_SRP/branches/joachim-event-branch/skins/waeup_accommodation/getFormattedBed.py @ 9819

Last change on this file since 9819 was 1596, checked in by joachim, 18 years ago

merged changes from trunk to joachim-event-branch

File size: 694 bytes
Line 
1## Script (Python) "getFormattedBed"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=bed=None,mode=None,datastructure=None
8##title=
9# $Id: getFormattedBed.py 1453 2007-02-20 22:24:30Z henrik $
10"""
11format the bed for readability
12"""
13
14if datastructure is not None:
15    bed = datastructure.get('bed')
16if not bed:
17    return ''
18if len(bed.split('_')) != 4:
19    return bed
20hall,block,room,letter = bed.split('_')
21info = context.waeup_tool.getAccommodationInfo(bed)
22if info:
23    hall_title = info['hall_title']
24else:
25    hall_title = ""
26return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter)
27
Note: See TracBrowser for help on using the repository browser.