jenkins-bot has submitted this change and it was merged.
Change subject: remove redundant backslashes between brackets ......................................................................
remove redundant backslashes between brackets
to fix pep8 errors: 7 E502 the backslash is redundant between brackets
also changed tox.ini to stop ignoring such errors
Change-Id: I3abe3da95441c984a173ad2da5b4c5e3bc6e0222 --- M pywikibot/textlib.py M pywikibot/userinterfaces/win32_unicode.py M scripts/image.py M scripts/template.py M setup.py M tox.ini 6 files changed, 9 insertions(+), 9 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py index 92d62d5..d0ac855 100644 --- a/pywikibot/textlib.py +++ b/pywikibot/textlib.py @@ -235,7 +235,7 @@ int(groupMatch.group('number'))) try: replacement = (replacement[:groupMatch.start()] + - ('' if match.group(groupID) is None else match.group(groupID)) + \ + (match.group(groupID) or '') + replacement[groupMatch.end():]) except IndexError: pywikibot.output('\nInvalid group reference: %s' % groupID) diff --git a/pywikibot/userinterfaces/win32_unicode.py b/pywikibot/userinterfaces/win32_unicode.py index 42714e2..a7bcfc4 100755 --- a/pywikibot/userinterfaces/win32_unicode.py +++ b/pywikibot/userinterfaces/win32_unicode.py @@ -113,7 +113,7 @@ real_stderr = False
if real_stdin: - ReadConsoleW = WINFUNCTYPE(BOOL, HANDLE, LPVOID, DWORD, POINTER(DWORD), \ + ReadConsoleW = WINFUNCTYPE(BOOL, HANDLE, LPVOID, DWORD, POINTER(DWORD), LPVOID)(("ReadConsoleW", windll.kernel32))
class UnicodeInput: @@ -136,7 +136,7 @@ # BOOL WINAPI WriteConsoleW(HANDLE hOutput, LPWSTR lpBuffer, DWORD nChars, # LPDWORD lpCharsWritten, LPVOID lpReserved);
- WriteConsoleW = WINFUNCTYPE(BOOL, HANDLE, LPWSTR, DWORD, POINTER(DWORD), \ + WriteConsoleW = WINFUNCTYPE(BOOL, HANDLE, LPWSTR, DWORD, POINTER(DWORD), LPVOID)(("WriteConsoleW", windll.kernel32))
class UnicodeOutput: diff --git a/scripts/image.py b/scripts/image.py index 32dbd2d..3189d71 100644 --- a/scripts/image.py +++ b/scripts/image.py @@ -142,7 +142,7 @@ replacements = []
if not self.site.nocapitalize: - case = re.escape(self.old_image[0].upper() + \ + case = re.escape(self.old_image[0].upper() + self.old_image[0].lower()) escaped = '[' + case + ']' + re.escape(self.old_image[1:]) else: diff --git a/scripts/template.py b/scripts/template.py index 5299610..c605d29 100755 --- a/scripts/template.py +++ b/scripts/template.py @@ -254,8 +254,8 @@ else: pattern = re.escape(old) pattern = re.sub(r'_|\ ', r'[_ ]', pattern) - templateRegex = re.compile(r'{{ *(' + ':|'.join(namespaces) + \ - r':|[mM][sS][gG]:)?' + pattern + \ + templateRegex = re.compile(r'{{ *(' + ':|'.join(namespaces) + + r':|[mM][sS][gG]:)?' + pattern + r'(?P<parameters>\s*|.+?|) *}}', re.DOTALL)
diff --git a/setup.py b/setup.py index 4dfcbce..e97d637 100644 --- a/setup.py +++ b/setup.py @@ -89,7 +89,7 @@ maintainer='The pywikibot team', maintainer_email='pywikipedia-l@lists.wikimedia.org', license='MIT License', - packages=['pywikibot'] + \ + packages=['pywikibot'] + [package for package in find_packages() if package.startswith('pywikibot.')], diff --git a/tox.ini b/tox.ini index 5e8d79a..0353c35 100644 --- a/tox.ini +++ b/tox.ini @@ -21,11 +21,11 @@ commands = {posargs}
[flake8] -ignore = E122,E127,E241,E265,E502 +ignore = E122,E127,E241,E265 exclude = .tox,.git,./*.egg,ez_setup.py,externals,user-config.py,./scripts/i18n/*,./pywikibot/date.py max_line_length = 256
[pep8] -ignore = E122,E127,E241,E502 +ignore = E122,E127,E241 exclude = .tox,.git,./*.egg,ez_setup.py,externals,user-config.py,./scripts/i18n/*,./pywikibot/date.py max_line_length = 256
pywikibot-commits@lists.wikimedia.org