## Script (Python) "students_indext"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=bed=None,mode=None,datastructure=None
##title=
# $Id: formatBed.py 828 2006-11-10 15:26:31Z joachim $
"""
format the bed for readability
"""

if datastructure is not None:
    bed = datastructure.get('bed')
if not bed:
    return ''
hall,block,room,letter = bed.split('_')
info = context.waeup_tool.getAccommodationInfo(bed)
if info:
    hall_title = info['hall_title']
else:
    hall_title = ""
return " %s / Block %s / Room %s / Bed %s" % (hall_title,block,room,letter)
