fix
This commit is contained in:
@@ -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()]
|
||||
|
||||
Reference in New Issue
Block a user