Private
Public Access
1
0

C2 and ST button to import all new workouts

This commit is contained in:
Sander Roosendaal
2017-05-17 11:54:02 +02:00
parent bb2283635e
commit 12d95cfe43
6 changed files with 218 additions and 69 deletions

View File

@@ -4,6 +4,21 @@ import numpy as np
lbstoN = 4.44822
def uniqify(seq, idfun=None):
# order preserving
if idfun is None:
def idfun(x): return x
seen = {}
result = []
for item in seq:
marker = idfun(item)
# in old Python versions:
# if seen.has_key(marker)
# but in new ones:
if marker in seen: continue
seen[marker] = 1
result.append(item)
return result
def serialize_list(value,token=','):
assert(isinstance(value, list) or isinstance(value, tuple) or isinstance(value,np.ndarray))