Private
Public Access
1
0

messages for upload

This commit is contained in:
Sander Roosendaal
2017-05-11 09:21:07 +02:00
parent 33e185912e
commit 80ebb91255
7 changed files with 68 additions and 42 deletions

View File

@@ -283,7 +283,6 @@ def uploadactivity(access_token,filename,description='',
with open("media/tperrors.log","a") as errorlog:
errorlog.write(str(resp.status_code))
errorlog.write("\r\n")
print "noot"
timestr = strftime("%Y%m%d-%H%M%S")
errorlog.write(timestr+"\r\n")
errorlog.write("\r\n")
@@ -296,14 +295,13 @@ def uploadactivity(access_token,filename,description='',
errorlog.write("\r\n")
return 0,resp.reason,resp.status_code,headers
else:
print resp.json()
return resp.json()[0]["Id"],"ok",200,""
return 0
def workout_tp_upload(user,w):
message = ""
message = "Uploading to TrainingPeaks"
tpid = 0
r = w.user
@@ -333,7 +331,7 @@ def workout_tp_upload(user,w):
tpid = res
w.save()
os.remove(tcxfile)
return '',tpid
return 'Successfully synchronized to TrainingPeaks',tpid
else: # no tcxfile
message = "Upload to TrainingPeaks failed"