Private
Public Access
1
0

adding simple export to Garmin

This commit is contained in:
Sander Roosendaal
2021-05-16 15:33:03 +02:00
parent 54190ed383
commit cbf7c4ab0b
9 changed files with 92 additions and 15 deletions

View File

@@ -775,7 +775,7 @@ def ps_dict_order_dict(d,short=False):
return sdict2
def ps_dict_order(d,short=False,rower=None):
def ps_dict_order(d,short=False,rower=None,html=True):
sdict = collections.OrderedDict({})
steps = d['steps']
@@ -836,7 +836,10 @@ def ps_dict_order(d,short=False,rower=None):
holduntil.append(item['repeatID'])
multiplier.append(item['repeatValue'])
factor *= item['repeatValue']
spaces += '   '
if html:
spaces += '   '
else:
spaces += ' '
if item['type'] == 'Step':
item['string'] = spaces+item['string']
sdict3.append(item)
@@ -847,7 +850,10 @@ def ps_dict_order(d,short=False,rower=None):
if item['stepID'] == holduntil[-1]:
sdict3.append(hold.pop())
factor /= multiplier.pop()
spaces = spaces[:-18]
if html:
spaces = spaces[:-18]
else:
spaces = spaces[:-3]
holduntil.pop()
else: # pragma: no cover
prevstep = sdict3.pop()
@@ -861,7 +867,10 @@ def ps_dict_order(d,short=False,rower=None):
factor /= multiplier.pop()
sdict3.append(prevstep)
holduntil.pop()
spaces = spaces[:-18]
if html:
spaces = spaces[:-18]
else:
spaces = spaces[:-3]
sdict = list(reversed(sdict3))