abstracted out step order from string creation
This commit is contained in:
@@ -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 = '<ul>'
|
||||
|
||||
for item in sdict:
|
||||
|
||||
Reference in New Issue
Block a user