Private
Public Access
1
0

removing obsolete rowingdata(csvfile)

This commit is contained in:
Sander Roosendaal
2019-11-11 17:31:56 +01:00
parent 23909feabf
commit 2294603129
6 changed files with 152 additions and 156 deletions

View File

@@ -3,7 +3,7 @@ from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import unicode_literals, absolute_import
# Interactions with Rowsandall.com API. Not fully complete.
# Interactions with Rowsandall.com API. Not fully complete.
# Python
import oauth2 as oauth
@@ -72,7 +72,7 @@ def do_refresh_token(refreshtoken):
'Content-Type': 'application/json'}
url = "http://localhost:8000/rowers/o/token"
response = requests.post(url,
data=json.dumps(post_data),
headers=headers)
@@ -94,14 +94,14 @@ def get_token(code):
"code": code,
"redirect_uri": "http://localhost:8000/rowers/test_callback",
"client_secret": "aapnootmies",
"client_id":1,
"client_id":1,
}
headers = {'Accept': 'application/json',
'Content-Type': 'application/json'}
url = "http://localhost:8000/rowers/o/token/"
response = requests.post(url,
data=json.dumps(post_data),
headers=headers)
@@ -111,7 +111,7 @@ def get_token(code):
expires_in = token_json['expires_in']
refresh_token = token_json['refresh_token']
return [thetoken,expires_in,refresh_token]
def make_authorization_url(request):
@@ -190,7 +190,7 @@ def get_ownapi_workout(user,ownapiid):
def createownapiworkoutdata(w):
filename = w.csvfilename
row = rowingdata(filename)
row = rowingdata(csvfile=filename)
averagehr = int(row.df[' HRCur (bpm)'].mean())
maxhr = int(row.df[' HRCur (bpm)'].max())
@@ -206,7 +206,7 @@ def createownapiworkoutdata(w):
hr = row.df[' HRCur (bpm)'].astype(int)
haslatlon=1
try:
lat = row.df[' latitude'].values
lon = row.df[' longitude'].values
@@ -281,7 +281,5 @@ def getidfromresponse(response):
t = json.loads(response.text)
uri = t['uris'][0]
id = uri[len(uri)-13:len(uri)-5]
return int(id)
return int(id)