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
|
return s,type, nr, repeatID
|
||||||
|
|
||||||
def ps_dict_get_description(d):
|
def ps_dict_order(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):
|
|
||||||
sdict = collections.OrderedDict({})
|
sdict = collections.OrderedDict({})
|
||||||
steps = d['steps']
|
steps = d['steps']
|
||||||
|
|
||||||
for step in steps:
|
for step in steps:
|
||||||
sstring, type, stepID, repeatID = step_to_string(step)
|
sstring, type, stepID, repeatID = step_to_string(step)
|
||||||
|
|
||||||
@@ -301,6 +285,19 @@ def ps_dict_get_description_html(d):
|
|||||||
|
|
||||||
sdict = list(reversed(sdict3))
|
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>'
|
s = '<ul>'
|
||||||
|
|
||||||
for item in sdict:
|
for item in sdict:
|
||||||
|
|||||||
Reference in New Issue
Block a user