Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2020-07-14 20:44:57 +02:00
parent d203b18d9d
commit f372986972

View File

@@ -1599,14 +1599,18 @@ def get_workouttype_from_fit(filename,workouttype='water'):
import rowingdata.tcxtools as tcxtools
def get_workouttype_from_tcx(filename,workouttype='water'):
d = tcxtools.tcx_getdict(filename)
tcxtype = 'rowing'
try:
tcxtype = d['Activities']['Activity']['@Sport'].lower()
if tcxtype == 'other':
tcxtype = 'rowing'
except KeyError:
return workouttype
d = tcxtools.tcx_getdict(filename)
try:
tcxtype = d['Activities']['Activity']['@Sport'].lower()
if tcxtype == 'other':
tcxtype = 'rowing'
except KeyError:
return workouttype
except TypeError:
pass
try:
workouttype = mytypes.garminmappinginv[tcxtype.upper()]