fix
This commit is contained in:
@@ -1599,8 +1599,9 @@ def get_workouttype_from_fit(filename,workouttype='water'):
|
|||||||
import rowingdata.tcxtools as tcxtools
|
import rowingdata.tcxtools as tcxtools
|
||||||
|
|
||||||
def get_workouttype_from_tcx(filename,workouttype='water'):
|
def get_workouttype_from_tcx(filename,workouttype='water'):
|
||||||
d = tcxtools.tcx_getdict(filename)
|
|
||||||
tcxtype = 'rowing'
|
tcxtype = 'rowing'
|
||||||
|
try:
|
||||||
|
d = tcxtools.tcx_getdict(filename)
|
||||||
try:
|
try:
|
||||||
tcxtype = d['Activities']['Activity']['@Sport'].lower()
|
tcxtype = d['Activities']['Activity']['@Sport'].lower()
|
||||||
if tcxtype == 'other':
|
if tcxtype == 'other':
|
||||||
@@ -1608,6 +1609,9 @@ def get_workouttype_from_tcx(filename,workouttype='water'):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
return workouttype
|
return workouttype
|
||||||
|
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
|
|
||||||
try:
|
try:
|
||||||
workouttype = mytypes.garminmappinginv[tcxtype.upper()]
|
workouttype = mytypes.garminmappinginv[tcxtype.upper()]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
|
|||||||
Reference in New Issue
Block a user