diff --git a/rowers/plannedsessions.py b/rowers/plannedsessions.py index 46918021..02dc0b40 100644 --- a/rowers/plannedsessions.py +++ b/rowers/plannedsessions.py @@ -250,26 +250,10 @@ def step_to_string(step): return s,type, nr, repeatID -def ps_dict_get_description(d): - sdict = {} - steps = d['steps'] - for step in steps: - sstring, type, stepID, repeatID = step_to_string(step) - - sdict[stepID] = { - 'string':sstring, - 'type':type, - 'stepID': stepID, - 'repeatID': repeatID, - } - - s += sstring+'\n' - - return s - -def ps_dict_get_description_html(d): +def ps_dict_order(d): sdict = collections.OrderedDict({}) steps = d['steps'] + for step in steps: sstring, type, stepID, repeatID = step_to_string(step) @@ -301,6 +285,19 @@ def ps_dict_get_description_html(d): sdict = list(reversed(sdict3)) + return sdict + +def ps_dict_get_description(d): + sdict = ps_dict_order(d) + s = '' + for item in sdict: + s += item['string']+'\n' + + return s + +def ps_dict_get_description_html(d): + sdict = ps_dict_order(d) + s = '