Private
Public Access
1
0

exports workout source to major fitness sites in notes

This commit is contained in:
Sander Roosendaal
2017-05-02 14:11:42 +02:00
parent 0d04132c3c
commit e711080269
8 changed files with 10 additions and 9 deletions

View File

@@ -230,7 +230,7 @@ def createc2workoutdata_as_splits(w):
"time": int(10*makeseconds(durationstr)),
"timezone": "Etc/UTC",
"weight_class": c2wc(w.weightcategory),
"comments": w.notes,
"comments": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
"heart_rate": {
"average": averagehr,
"max": maxhr,

View File

@@ -228,7 +228,7 @@ def createrunkeeperworkoutdata(w):
"start_time": start_time,
"total_distance": int(w.distance),
"duration": duration,
"notes": w.notes,
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
"average_heart_rate": averagehr,
"path": locdata,
"distance": distancedata,
@@ -242,7 +242,7 @@ def createrunkeeperworkoutdata(w):
"start_time": start_time,
"total_distance": int(w.distance),
"duration": duration,
"notes": w.notes,
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
"avg_heartrate": averagehr,
"distance": distancedata,
"heart_rate": hrdata,

View File

@@ -264,7 +264,7 @@ def createsporttracksworkoutdata(w):
"start_time": w.startdatetime.isoformat(),
"total_distance": int(w.distance),
"duration": duration,
"notes": w.notes,
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
"avg_heartrate": averagehr,
"max_heartrate": maxhr,
"location": locdata,
@@ -280,7 +280,7 @@ def createsporttracksworkoutdata(w):
"start_time": w.startdatetime.isoformat(),
"total_distance": int(w.distance),
"duration": duration,
"notes": w.notes,
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
"avg_heartrate": averagehr,
"max_heartrate": maxhr,
"distance": distancedata,

View File

@@ -239,7 +239,7 @@ def createstravaworkoutdata(w):
try:
row = rowingdata(filename)
tcxfilename = filename[:-4]+'.tcx'
row.exporttotcx(tcxfilename,notes=w.notes)
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()

View File

@@ -187,7 +187,7 @@ def createtpworkoutdata(w):
try:
row = rowingdata(filename)
tcxfilename = filename[:-4]+'.tcx'
row.exporttotcx(tcxfilename,notes=w.notes)
row.exporttotcx(tcxfilename,notes=w.notes+'\n from '+w.workoutsource+' via rowsandall.com')
return tcxfilename
except:
tcxfilename = 0

View File

@@ -214,7 +214,7 @@ def createunderarmourworkoutdata(w):
duration += w.duration.second
duration += +1.0e-6*w.duration.microsecond
name = w.name
notes = w.notes
notes = w.notes+'\n from '+w.workoutsource+' via rowsandall.com'
# adding diff, trying to see if this is valid
#t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']

View File

@@ -1314,7 +1314,7 @@ def workout_strava_upload_view(request,id=0):
with open(tcxfile,'rb') as f:
res,mes = stravastuff.handle_stravaexport(f,w.name,
r.stravatoken,
description=w.notes)
description=w.notes+'\n from '+w.workoutsource+' via rowsandall.com')
if res==0:
message = mes
w.uploadedtostrava = -1

View File

@@ -215,6 +215,7 @@ LOGOUT_URL = '/logout/'
C2_CLIENT_ID = CFG['c2_client_id']
C2_CLIENT_SECRET = CFG['c2_client_secret']
C2_REDIRECT_URI = "http://rowsandall.com/call_back"
#C2_REDIRECT_URI = "http://localhost:8000/call_back"
# Strava