From 8313f32e740689887ce882c859ec489f9627a512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Michael=20O=2E=20Hegg=C3=B8?= <danmichaelo@gmail.com> Date: Mon, 10 Jun 2019 14:41:59 +0200 Subject: [PATCH] Fix/markup lint issues --- mwclient/__init__.py | 4 ++-- mwclient/client.py | 6 ++++-- mwclient/errors.py | 16 ++++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/mwclient/__init__.py b/mwclient/__init__.py index 665c3dc..772e3d0 100644 --- a/mwclient/__init__.py +++ b/mwclient/__init__.py @@ -23,8 +23,8 @@ OTHER DEALINGS IN THE SOFTWARE. """ -from mwclient.errors import * # pylint: disable=unused-import -from mwclient.client import Site, __ver__ # pylint: disable=unused-import +from mwclient.errors import * # noqa: F401, F403 # pylint: disable=unused-import +from mwclient.client import Site, __ver__ # noqa: F401 # pylint: disable=unused-import import logging import warnings diff --git a/mwclient/client.py b/mwclient/client.py index a9301a0..db673fc 100644 --- a/mwclient/client.py +++ b/mwclient/client.py @@ -313,8 +313,10 @@ class Site(object): return False # cope with https://phabricator.wikimedia.org/T106066 - if (info['error'].get('code') == u'mwoauth-invalid-authorization' and - 'Nonce already used' in info['error'].get('info')): + if ( + info['error'].get('code') == u'mwoauth-invalid-authorization' + and 'Nonce already used' in info['error'].get('info') + ): log.warning('retrying due to nonce error https://phabricator.wikimedia.org/T106066') sleeper.sleep() return False diff --git a/mwclient/errors.py b/mwclient/errors.py index 763c3af..845cf31 100644 --- a/mwclient/errors.py +++ b/mwclient/errors.py @@ -73,11 +73,11 @@ class OAuthAuthorizationError(LoginError): class AssertUserFailedError(MwClientError): def __init__(self): - super(AssertUserFailedError, self).__init__( - 'By default, mwclient protects you from accidentally editing ' + - 'without being logged in. If you actually want to edit without ' + + super(AssertUserFailedError, self).__init__(( + 'By default, mwclient protects you from accidentally editing ' + 'without being logged in. If you actually want to edit without ' 'logging in, you can set force_login on the Site object to False.' - ) + )) def __str__(self): return self.args[0] @@ -98,10 +98,10 @@ class NoWriteApi(MwClientError): class InvalidResponse(MwClientError): def __init__(self, response_text=None): - super(InvalidResponse, self).__init__( - 'Did not get a valid JSON response from the server. Check that ' + - 'you used the correct hostname. If you did, the server might ' + - 'be wrongly configured or experiencing temporary problems.', + super(InvalidResponse, self).__init__(( + 'Did not get a valid JSON response from the server. Check that ' + 'you used the correct hostname. If you did, the server might ' + 'be wrongly configured or experiencing temporary problems.'), response_text ) self.response_text = response_text -- GitLab