Switch to Poetry and Black (#254)

* Pipenv -> Poetry

* poetry and black
This commit is contained in:
Henning Jacobs
2019-12-23 20:07:46 +01:00
committed by GitHub
parent 578b03d214
commit d8b94db671
22 changed files with 1575 additions and 959 deletions

View File

@@ -3,17 +3,17 @@ import os
from flask_dance.consumer import OAuth2ConsumerBlueprint
CREDENTIALS_DIR = os.getenv('CREDENTIALS_DIR', '')
CREDENTIALS_DIR = os.getenv("CREDENTIALS_DIR", "")
class OAuth2ConsumerBlueprintWithClientRefresh(OAuth2ConsumerBlueprint):
'''Same as flask_dance.consumer.OAuth2ConsumerBlueprint, but loads client credentials from file'''
"""Same as flask_dance.consumer.OAuth2ConsumerBlueprint, but loads client credentials from file"""
def refresh_credentials(self):
with open(os.path.join(CREDENTIALS_DIR, 'authcode-client-id')) as fd:
with open(os.path.join(CREDENTIALS_DIR, "authcode-client-id")) as fd:
# note that we need to set two attributes because of how OAuth2ConsumerBlueprint works :-/
self._client_id = self.client_id = fd.read().strip()
with open(os.path.join(CREDENTIALS_DIR, 'authcode-client-secret')) as fd:
with open(os.path.join(CREDENTIALS_DIR, "authcode-client-secret")) as fd:
self.client_secret = fd.read().strip()
def login(self):