removing obsolete rowingdata(csvfile)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user