Private
Public Access
1
0

switched off error catching in stravaworkoutdata

This commit is contained in:
Sander Roosendaal
2017-05-22 15:15:44 +02:00
parent f735d6a18c
commit d25d41d496

View File

@@ -247,26 +247,23 @@ def get_strava_workout(user,stravaid):
# Generate Workout data for Strava (a TCX file) # Generate Workout data for Strava (a TCX file)
def createstravaworkoutdata(w): def createstravaworkoutdata(w):
filename = w.csvfilename filename = w.csvfilename
try:
row = rowingdata(filename)
tcxfilename = filename[:-4]+'.tcx'
row.exporttotcx(tcxfilename,notes=w.notes+'\n from '+w.workoutsource+' via rowsandall.com')
gzfilename = tcxfilename+'.gz'
with file(tcxfilename,'rb') as inF:
s = inF.read()
with gzip.GzipFile(gzfilename,'wb') as outF:
outF.write(s)
try:
os.remove(tcxfilename)
except WindowError:
pass
return gzfilename,""
except:
message = "createstravaworkoutdata "+str(sys.exc_info()[0])
tcxfilename = 0
return tcxfilename,message row = rowingdata(filename)
tcxfilename = filename[:-4]+'.tcx'
row.exporttotcx(tcxfilename,notes=w.notes+'\n from '+w.workoutsource+' via rowsandall.com')
gzfilename = tcxfilename+'.gz'
with file(tcxfilename,'rb') as inF:
s = inF.read()
with gzip.GzipFile(gzfilename,'wb') as outF:
outF.write(s)
try:
os.remove(tcxfilename)
except WindowError:
pass
return gzfilename,""
# Upload the TCX file to Strava and set the workout activity type # Upload the TCX file to Strava and set the workout activity type
# to rowing on Strava # to rowing on Strava