Skip to content

Commit 275f9ab

Browse files
committed
Fixed pylint logging complaints
1 parent 823e166 commit 275f9ab

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

mrmat_python_api_flask/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def create_app(config_override=None, instance_path=None):
9898
# When using Flask-SQLAlchemy, there is no need to explicitly import DAO classes because they themselves
9999
# inherit from the SQLAlchemy model
100100

101-
global db, ma, migrate
102101
db.init_app(app)
103102
migrate.init_app(app, db)
104103
ma.init_app(app)

mrmat_python_api_flask/client.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def main(argv=None) -> int:
162162

163163
config = {}
164164
if os.path.exists(os.path.expanduser(args.config)):
165-
with open(os.path.expanduser(args.config)) as c:
165+
with open(os.path.expanduser(args.config), encoding='UTF-8') as c:
166166
config = json.load(c)
167167
config_override = vars(args)
168168
for key in config_override.keys() & config_override.keys():
@@ -187,8 +187,11 @@ def main(argv=None) -> int:
187187
raise ClientException(msg='No expires_in in device_auth')
188188

189189
# Adding the user code to the URL is convenient, but not as secure as it could be
190-
log.info(f'Please visit {device_auth["verification_uri"]} within {device_auth["expires_in"]} seconds and '
191-
f'enter code {device_auth["user_code"]}. Or just visit {device_auth["verification_uri_complete"]}')
190+
log.info('Please visit {} within {} seconds and enter code {}. Or just visit {}',
191+
device_auth['verification_uri'],
192+
device_auth['expires_in'],
193+
device_auth['user_code'],
194+
device_auth['verification_uri_complete'])
192195

193196
auth = oidc_check_auth(config, discovery, device_auth)
194197
log.info('Authenticated')
@@ -198,7 +201,7 @@ def main(argv=None) -> int:
198201

199202
resp = requests.get('http://127.0.0.1:5000/api/greeting/v3/',
200203
headers={'Authorization': f'Bearer {auth["id_token"]}'})
201-
log.info(f'Status Code: {resp.status_code}')
204+
log.info('Status Code: {}', resp.status_code)
202205
log.info(resp.content)
203206

204207
return 0

0 commit comments

Comments
 (0)