## Script (Python) "getSchoolFee" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=brain=None ##title= ## # $Id: getSchoolFee.py 8297 2012-04-27 11:20:01Z henrik $ """ return SchoolFee """ #all_fees = context.uniben_school_fees() #import csv #from Globals import INSTANCE_HOME #fees_path = "%s/import/school_fees.csv" % (INSTANCE_HOME) #reader = csv.DictReader(open(fees_path, 'r')) #lst = [i for i in reader] #all_fees = dict([(i['payment_item'],i) for i in lst]) wtool = context.waeup_tool try: all_fees = wtool.getSchoolFees() except: return None next_info = context.getNextInfo(brain) next_session_str = next_info['next_session_str'] description = "School Fee for Session %s" % next_session_str d = {} if all_fees.has_key(brain.course): d = all_fees[brain.course] d['description'] = "%s (%s)" % (description,brain.course) else: return None d['next_session_id'] = next_info['next_session_id'] return d