jenkins-bot has submitted this change and it was merged.
Change subject: Remove __all__ trickery
......................................................................
Remove __all__ trickery
pywikibot __init__ used several tricks to work around
pep257 and pyflakes limitations. Those tools have been
fixed, and the workarounds can now be removed.
Change-Id: If089ad228f7b8f00d3a32be2ce131e17698d72f8
---
M dev-requirements.txt
M pywikibot/__init__.py
2 files changed, 32 insertions(+), 32 deletions(-)
Approvals:
XZise: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/dev-requirements.txt b/dev-requirements.txt
index ee37c1b..81a77de 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -6,6 +6,11 @@
nose
+pep8
+pep257>=0.6
+pyflakes>=0.9
+flake8
+
# pywin32 & pywinauto>=0.4.0 are Win32 UI test dependencies that have been
# excluded from this file as they are quite expensive to install, and they
# are not useful on the Appveyor Win32 builds since the relevant UI tests
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index b1d2cc3..8ff99bf 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""The initialization file for the Pywikibot framework."""
#
-# (C) Pywikibot team, 2008-2014
+# (C) Pywikibot team, 2008-2015
#
# Distributed under the terms of the MIT license.
#
@@ -67,37 +67,32 @@
'replaceCategoryInPlace', 'compileLinkR',
'extract_templates_and_params',
)
-# pep257 doesn't understand when the first entry is on the next line
-__all__ = ('config', 'ui', 'UnicodeMixin', 'translate',
- 'Page', 'FilePage', 'Category', 'Link',
'User',
- 'ItemPage', 'PropertyPage', 'Claim',
'TimeStripper',
- 'html2unicode', 'url2unicode', 'unicode2html',
- 'stdout', 'output', 'warning', 'error',
'critical', 'debug',
- 'exception', 'input_choice', 'input',
'input_yn', 'inputChoice',
- 'handle_args', 'handleArgs', 'showHelp', 'ui',
'log',
- 'calledModuleName', 'Bot', 'CurrentPageBot',
'WikidataBot',
- 'Error', 'InvalidTitle', 'BadTitle', 'NoPage',
'NoMoveTarget',
- 'SectionError',
- 'SiteDefinitionError', 'NoSuchSite', 'UnknownSite',
'UnknownFamily',
- 'UnknownExtension',
- 'NoUsername', 'UserBlocked', 'UserActionRefuse',
- 'PageRelatedError', 'IsRedirectPage',
'IsNotRedirectPage',
- 'PageSaveRelatedError', 'PageNotSaved',
'OtherPageSaveError',
- 'LockedPage', 'CascadeLockedPage', 'LockedNoPage',
'NoCreateError',
- 'EditConflict', 'PageDeletedConflict',
'PageCreatedConflict',
- 'UploadWarning',
- 'ServerError', 'FatalServerError', 'Server504Error',
- 'CaptchaError', 'SpamfilterError',
'CircularRedirect',
- 'InterwikiRedirectPage',
- 'WikiBaseError', 'CoordinateGlobeUnknownException',
- 'QuitKeyboardInterrupt',
- )
-# flake8 is unable to detect concatenation in the same operation
-# like:
-# ) + textlib_methods
-# pep257 also doesn't support __all__ multiple times in a document
-# so instead use this trick
-globals()['__all__'] = globals()['__all__'] + textlib_methods
+__all__ = (
+ 'config', 'ui', 'UnicodeMixin', 'translate',
+ 'Page', 'FilePage', 'Category', 'Link',
'User',
+ 'ItemPage', 'PropertyPage', 'Claim', 'TimeStripper',
+ 'html2unicode', 'url2unicode', 'unicode2html',
+ 'stdout', 'output', 'warning', 'error',
'critical', 'debug',
+ 'exception', 'input_choice', 'input', 'input_yn',
'inputChoice',
+ 'handle_args', 'handleArgs', 'showHelp', 'ui',
'log',
+ 'calledModuleName', 'Bot', 'CurrentPageBot',
'WikidataBot',
+ 'Error', 'InvalidTitle', 'BadTitle', 'NoPage',
'NoMoveTarget',
+ 'SectionError',
+ 'SiteDefinitionError', 'NoSuchSite', 'UnknownSite',
'UnknownFamily',
+ 'UnknownExtension',
+ 'NoUsername', 'UserBlocked', 'UserActionRefuse',
+ 'PageRelatedError', 'IsRedirectPage', 'IsNotRedirectPage',
+ 'PageSaveRelatedError', 'PageNotSaved',
'OtherPageSaveError',
+ 'LockedPage', 'CascadeLockedPage', 'LockedNoPage',
'NoCreateError',
+ 'EditConflict', 'PageDeletedConflict',
'PageCreatedConflict',
+ 'UploadWarning',
+ 'ServerError', 'FatalServerError', 'Server504Error',
+ 'CaptchaError', 'SpamfilterError', 'CircularRedirect',
+ 'InterwikiRedirectPage',
+ 'WikiBaseError', 'CoordinateGlobeUnknownException',
+ 'QuitKeyboardInterrupt',
+)
+__all__ += textlib_methods
for _name in textlib_methods:
target = getattr(textlib, _name)
--
To view, visit
https://gerrit.wikimedia.org/r/226761
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If089ad228f7b8f00d3a32be2ce131e17698d72f8
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>