refactoring importviews, part 1
This commit is contained in:
@@ -51,6 +51,12 @@ class TPIntegration(SyncIntegration):
|
||||
'scope': 'write',
|
||||
}
|
||||
|
||||
def get_name(self):
|
||||
return "TrainingPeaks"
|
||||
|
||||
def get_shortname(self):
|
||||
return "trainingpeaks"
|
||||
|
||||
def createworkoutdata(self, w, *args, **kwargs):
|
||||
filename = w.csvfilename
|
||||
row = rowingdata(csvfile=filename)
|
||||
@@ -88,7 +94,16 @@ class TPIntegration(SyncIntegration):
|
||||
raise NotImplementedError("not implemented")
|
||||
|
||||
def make_authorization_url(self, *args, **kwargs) -> str: # pragma: no cover
|
||||
return super(TPIntegration, self).make_authorization_url(self, *args, **kwargs)
|
||||
params = {"client_id": TP_CLIENT_KEY,
|
||||
"response_type": "code",
|
||||
"redirect_uri": TP_REDIRECT_URI,
|
||||
"scope": "file:write",
|
||||
}
|
||||
url = TP_OAUTH_LOCATION+"oauth/authorize/?" + \
|
||||
urllib.parse.urlencode(params)
|
||||
|
||||
return url
|
||||
|
||||
|
||||
def get_token(self, code, *args, **kwargs) -> (str, int, str):
|
||||
# client_auth = requests.auth.HTTPBasicAuth(TP_CLIENT_KEY, TP_CLIENT_SECRET)
|
||||
|
||||
Reference in New Issue
Block a user