From 407dc04b28985df8cdc3e4f19a2876b25aa0aca4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 17 Sep 2018 22:20:19 +0200 Subject: [PATCH] Fix pylint errors --- gajim/common/connection.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/gajim/common/connection.py b/gajim/common/connection.py index 4f5f29544..a6694c6a3 100644 --- a/gajim/common/connection.py +++ b/gajim/common/connection.py @@ -1784,36 +1784,38 @@ class Connection(CommonConnection, ConnectionHandlers): def get_password(self, callback, type_): if app.config.get_per('accounts', self.name, 'anonymous_auth') and \ type_ != 'ANONYMOUS': - app.nec.push_incoming_event(NonAnonymousServerErrorEvent(None, - conn=self)) + app.nec.push_incoming_event( + NonAnonymousServerErrorEvent(None, conn=self)) self._on_disconnected() return self.pasword_callback = (callback, type_) if type_ == 'X-MESSENGER-OAUTH2': client_id = app.config.get_per('accounts', self.name, - 'oauth2_client_id') + 'oauth2_client_id') refresh_token = app.config.get_per('accounts', self.name, - 'oauth2_refresh_token') + 'oauth2_refresh_token') if refresh_token: - renew_URL = 'https://oauth.live.com/token?client_id=' \ - '%(client_id)s&redirect_uri=https%%3A%%2F%%2Foauth.live.' \ - 'com%%2Fdesktop&grant_type=refresh_token&refresh_token=' \ - '%(refresh_token)s' % locals() - result = helpers.download_image(self.name, {'src': renew_URL})[0] + renew_url = ( + 'https://oauth.live.com/token?client_id=' + '%s&redirect_uri=https%%3A%%2F%%2Foauth.live.' + 'com%%2Fdesktop&grant_type=refresh_token&' + 'refresh_token=%s') % (client_id, refresh_token) + result = helpers.download_image(self.name, {'src': renew_url})[0] if result: dict_ = json.loads(result) if 'access_token' in dict_: self.set_password(dict_['access_token']) return script_url = app.config.get_per('accounts', self.name, - 'oauth2_redirect_url') - token_URL = 'https://oauth.live.com/authorize?client_id=' \ - '%(client_id)s&scope=wl.messenger%%20wl.offline_access&' \ - 'response_type=code&redirect_uri=%(script_url)s' % locals() - helpers.launch_browser_mailer('url', token_URL) + 'oauth2_redirect_url') + token_url = ( + 'https://oauth.live.com/authorize?client_id=' + '%s&scope=wl.messenger%%20wl.offline_access&' + 'response_type=code&redirect_uri=%s') % (client_id, script_url) + helpers.launch_browser_mailer('url', token_url) self.disconnect(on_purpose=True) - app.nec.push_incoming_event(Oauth2CredentialsRequiredEvent(None, - conn=self)) + app.nec.push_incoming_event( + Oauth2CredentialsRequiredEvent(None, conn=self)) return if self.password: self.set_password(self.password)