exports workout source to major fitness sites in notes
This commit is contained in:
@@ -230,7 +230,7 @@ def createc2workoutdata_as_splits(w):
|
|||||||
"time": int(10*makeseconds(durationstr)),
|
"time": int(10*makeseconds(durationstr)),
|
||||||
"timezone": "Etc/UTC",
|
"timezone": "Etc/UTC",
|
||||||
"weight_class": c2wc(w.weightcategory),
|
"weight_class": c2wc(w.weightcategory),
|
||||||
"comments": w.notes,
|
"comments": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
|
||||||
"heart_rate": {
|
"heart_rate": {
|
||||||
"average": averagehr,
|
"average": averagehr,
|
||||||
"max": maxhr,
|
"max": maxhr,
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ def createrunkeeperworkoutdata(w):
|
|||||||
"start_time": start_time,
|
"start_time": start_time,
|
||||||
"total_distance": int(w.distance),
|
"total_distance": int(w.distance),
|
||||||
"duration": duration,
|
"duration": duration,
|
||||||
"notes": w.notes,
|
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
|
||||||
"average_heart_rate": averagehr,
|
"average_heart_rate": averagehr,
|
||||||
"path": locdata,
|
"path": locdata,
|
||||||
"distance": distancedata,
|
"distance": distancedata,
|
||||||
@@ -242,7 +242,7 @@ def createrunkeeperworkoutdata(w):
|
|||||||
"start_time": start_time,
|
"start_time": start_time,
|
||||||
"total_distance": int(w.distance),
|
"total_distance": int(w.distance),
|
||||||
"duration": duration,
|
"duration": duration,
|
||||||
"notes": w.notes,
|
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
|
||||||
"avg_heartrate": averagehr,
|
"avg_heartrate": averagehr,
|
||||||
"distance": distancedata,
|
"distance": distancedata,
|
||||||
"heart_rate": hrdata,
|
"heart_rate": hrdata,
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ def createsporttracksworkoutdata(w):
|
|||||||
"start_time": w.startdatetime.isoformat(),
|
"start_time": w.startdatetime.isoformat(),
|
||||||
"total_distance": int(w.distance),
|
"total_distance": int(w.distance),
|
||||||
"duration": duration,
|
"duration": duration,
|
||||||
"notes": w.notes,
|
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
|
||||||
"avg_heartrate": averagehr,
|
"avg_heartrate": averagehr,
|
||||||
"max_heartrate": maxhr,
|
"max_heartrate": maxhr,
|
||||||
"location": locdata,
|
"location": locdata,
|
||||||
@@ -280,7 +280,7 @@ def createsporttracksworkoutdata(w):
|
|||||||
"start_time": w.startdatetime.isoformat(),
|
"start_time": w.startdatetime.isoformat(),
|
||||||
"total_distance": int(w.distance),
|
"total_distance": int(w.distance),
|
||||||
"duration": duration,
|
"duration": duration,
|
||||||
"notes": w.notes,
|
"notes": w.notes+'\n from '+w.workoutsource+' via rowsandall.com',
|
||||||
"avg_heartrate": averagehr,
|
"avg_heartrate": averagehr,
|
||||||
"max_heartrate": maxhr,
|
"max_heartrate": maxhr,
|
||||||
"distance": distancedata,
|
"distance": distancedata,
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ def createstravaworkoutdata(w):
|
|||||||
try:
|
try:
|
||||||
row = rowingdata(filename)
|
row = rowingdata(filename)
|
||||||
tcxfilename = filename[:-4]+'.tcx'
|
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'
|
gzfilename = tcxfilename+'.gz'
|
||||||
with file(tcxfilename,'rb') as inF:
|
with file(tcxfilename,'rb') as inF:
|
||||||
s = inF.read()
|
s = inF.read()
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ def createtpworkoutdata(w):
|
|||||||
try:
|
try:
|
||||||
row = rowingdata(filename)
|
row = rowingdata(filename)
|
||||||
tcxfilename = filename[:-4]+'.tcx'
|
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
|
return tcxfilename
|
||||||
except:
|
except:
|
||||||
tcxfilename = 0
|
tcxfilename = 0
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ def createunderarmourworkoutdata(w):
|
|||||||
duration += w.duration.second
|
duration += w.duration.second
|
||||||
duration += +1.0e-6*w.duration.microsecond
|
duration += +1.0e-6*w.duration.microsecond
|
||||||
name = w.name
|
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
|
# adding diff, trying to see if this is valid
|
||||||
#t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
|
#t = row.df.ix[:,'TimeStamp (sec)'].values-10*row.df.ix[0,'TimeStamp (sec)']
|
||||||
|
|||||||
@@ -1314,7 +1314,7 @@ def workout_strava_upload_view(request,id=0):
|
|||||||
with open(tcxfile,'rb') as f:
|
with open(tcxfile,'rb') as f:
|
||||||
res,mes = stravastuff.handle_stravaexport(f,w.name,
|
res,mes = stravastuff.handle_stravaexport(f,w.name,
|
||||||
r.stravatoken,
|
r.stravatoken,
|
||||||
description=w.notes)
|
description=w.notes+'\n from '+w.workoutsource+' via rowsandall.com')
|
||||||
if res==0:
|
if res==0:
|
||||||
message = mes
|
message = mes
|
||||||
w.uploadedtostrava = -1
|
w.uploadedtostrava = -1
|
||||||
|
|||||||
@@ -215,6 +215,7 @@ LOGOUT_URL = '/logout/'
|
|||||||
C2_CLIENT_ID = CFG['c2_client_id']
|
C2_CLIENT_ID = CFG['c2_client_id']
|
||||||
C2_CLIENT_SECRET = CFG['c2_client_secret']
|
C2_CLIENT_SECRET = CFG['c2_client_secret']
|
||||||
C2_REDIRECT_URI = "http://rowsandall.com/call_back"
|
C2_REDIRECT_URI = "http://rowsandall.com/call_back"
|
||||||
|
#C2_REDIRECT_URI = "http://localhost:8000/call_back"
|
||||||
|
|
||||||
# Strava
|
# Strava
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user