Private
Public Access
1
0

abstracted out step order from string creation

This commit is contained in:
Sander Roosendaal
2021-02-26 19:31:28 +01:00
parent e6457962ab
commit a4e643452c

View File

@@ -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: