Private
Public Access
1
0

Merge tag 'v2.97' into develop

removed strava error catching
This commit is contained in:
Sander Roosendaal
2017-05-22 15:17:21 +02:00

View File

@@ -247,26 +247,23 @@ def get_strava_workout(user,stravaid):
# Generate Workout data for Strava (a TCX file)
def createstravaworkoutdata(w):
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
# to rowing on Strava