jenkins-bot has submitted this change and it was merged.
Change subject: Pass pep8 1.6.x
......................................................................
Pass pep8 1.6.x
Ignored some annoying errors:
E115 expected an indented block (comment)
E266 too many leading '#' for block comment
Due to blocks of code being commented out.
E402 module level import not at top of file
Too spammy to fix them all.
E731 do not assign a lambda expression, use a def
lambdas are uses quite a lot, potentially can be refactored one day,
but don't bother for now.
W503 line break before binary operator
In the cases I looked at, that does not seem to compromise the
readability or understand of the code flow.
Ignore with noqa:
./mysql_autoconnection.py:98:30: E721 do not compare types, use
'isinstance()'
if type(cursorclass) is not type(self.__cursor):
Change-Id: I687d6d7cfc5f47aafd43f134ee65c4bb8d1c9353
---
M mysql_autoconnection.py
M tox.ini
2 files changed, 8 insertions(+), 3 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
Hashar: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/mysql_autoconnection.py b/mysql_autoconnection.py
index 7116dd9..5495551 100644
--- a/mysql_autoconnection.py
+++ b/mysql_autoconnection.py
@@ -95,7 +95,7 @@
pass
def cursor(self, cursorclass=MySQLdb.cursors.Cursor):
- if type(cursorclass) is not type(self.__cursor):
+ if type(cursorclass) is not type(self.__cursor): # noqa
self.__cursor = self.database.cursor(cursorclass)
return self
diff --git a/tox.ini b/tox.ini
index 1a0236b..cf8308c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,11 +4,16 @@
[testenv:lint]
commands = pep8
-deps = pep8<1.6
+deps = pep8<1.7
[pep8]
# E112 expected an indented block
+# E115 expected an indented block (comment)
# E265 block comment should start with '# '
-ignore = E112,E122,E127,E241,E226,E265,E502,W602
+# E266 too many leading '#' for block comment
+# E402 module level import not at top of file
+# E731 do not assign a lambda expression, use a def
+# W503 line break before binary operator
+ignore = E112,E115,E122,E127,E241,E226,E265,E266,E402,E502,E731,W503,W602
exclude = ./catimages.py,./wiktionary.py,./wiktionary/*,./tests/*,./userinterfaces/*,./commonsdelinker/*,./families/*,./maintenance/*,./pywikibot/*,./externals/*,./.tox
max_line_length = 256
--
To view, visit https://gerrit.wikimedia.org/r/242870
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I687d6d7cfc5f47aafd43f134ee65c4bb8d1c9353
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: Pass pep8 1.5.x
......................................................................
Pass pep8 1.5.x
Ignored some annoying errors:
E112 expected an indented block
Because lot of code is commented out at the very beginning of line
E265 block comment should start with '# '
Rather annoying, but not much of a trouble. There is code commented
out with ##
Change-Id: Ic923f50508a32f029d1e682511cd46357331dfc4
---
M checkimages.py
M interwiki.py
M parserfunctioncount.py
M standardize_notes.py
M tox.ini
M wikipedia.py
6 files changed, 22 insertions(+), 15 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/checkimages.py b/checkimages.py
index 8f161b1..333f97f 100644
--- a/checkimages.py
+++ b/checkimages.py
@@ -1441,8 +1441,8 @@
if self.allLicenses:
self.license_found = self.allLicenses[0].title()
- self.some_problem = False # If it has "some_problem" it must check
- # the additional settings.
+ # If it has "some_problem" it must check the additional settings.
+ self.some_problem = False
if self.settingsData:
# use additional settings
diff --git a/interwiki.py b/interwiki.py
index 100044f..2011015 100644
--- a/interwiki.py
+++ b/interwiki.py
@@ -1442,7 +1442,7 @@
# FIXME: What errors are we catching here?
# except: should be avoided!!
except:
- #raise
+ #raise
pywikibot.output(u'File autonomous_problems.dat open or '
u'corrupted! Try again with -restore.')
sys.exit()
diff --git a/parserfunctioncount.py b/parserfunctioncount.py
index 2c5c863..9d0e306 100644
--- a/parserfunctioncount.py
+++ b/parserfunctioncount.py
@@ -59,10 +59,11 @@
def main(*args):
+ # default is left out because it may occur within switch only.
words = ['expr', 'if', 'ifeq', 'ifexpr', 'iferror', 'switch', 'ifexist',
'time', 'timel', 'rel2abs', 'titleparts', 'len', 'pos', 'rpos',
'sub', 'count', 'replace', 'explode', 'urldecode']
- # default is left out because it may occur within switch only.
+
addwords = {
# Write translated parser function names here.
'hu': [u'kif', u'ha', u'haegyenlő', u'hakif', u'hahibás', u'halétezik',
diff --git a/standardize_notes.py b/standardize_notes.py
index d0b3d47..714716b 100644
--- a/standardize_notes.py
+++ b/standardize_notes.py
@@ -625,10 +625,11 @@
text_line = (
text_line[:m.start(0)] +
'{{ref_label|%s|%d|%s}}'
- % (refkey, (refusage[refkey][0]) + 1,
- string.ascii_lowercase[
- ((refusage[refkey][2]) - 1) % 26
- ]) + text_line[m.end(0):])
+ % (
+ refkey,
+ (refusage[refkey][0]) + 1,
+ string.ascii_lowercase[((refusage[refkey][2]) - 1) % 26]
+ ) + text_line[m.end(0):])
# count use of reference
refusage[refkey][2] += 1
else:
diff --git a/tox.ini b/tox.ini
index 33bd621..1a0236b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,9 +4,11 @@
[testenv:lint]
commands = pep8
-deps = pep8==1.4.6
+deps = pep8<1.6
[pep8]
-ignore = E122,E127,E241,E226,E502,W602
+# E112 expected an indented block
+# E265 block comment should start with '# '
+ignore = E112,E122,E127,E241,E226,E265,E502,W602
exclude = ./catimages.py,./wiktionary.py,./wiktionary/*,./tests/*,./userinterfaces/*,./commonsdelinker/*,./families/*,./maintenance/*,./pywikibot/*,./externals/*,./.tox
max_line_length = 256
diff --git a/wikipedia.py b/wikipedia.py
index 35438b5..9cd3d09 100644
--- a/wikipedia.py
+++ b/wikipedia.py
@@ -9983,13 +9983,15 @@
global logger # _handlers_initialized
if not logger:
+ # for messages to be displayed on terminal at "verbose" setting
+ # use INFO for messages to be displayed even on non-verbose setting
logging.addLevelName(VERBOSE, "VERBOSE")
- # for messages to be displayed on terminal at "verbose" setting
- # use INFO for messages to be displayed even on non-verbose setting
+
+ # for messages to be displayed to stdout
logging.addLevelName(STDOUT, "STDOUT")
- # for messages to be displayed to stdout
+
+ # for prompts requiring user response
logging.addLevelName(INPUT, "INPUT")
- # for prompts requiring user response
logger = logging.getLogger() # root logger
@@ -10418,8 +10420,9 @@
"""
def remaining():
+ # -1 because we added a None element to stop the queue
remainingPages = page_put_queue.qsize() - 1
- # -1 because we added a None element to stop the queue
+
remainingSeconds = datetime.timedelta(
seconds=(remainingPages * put_throttle.getDelay(True)))
return (remainingPages, remainingSeconds)
--
To view, visit https://gerrit.wikimedia.org/r/242867
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic923f50508a32f029d1e682511cd46357331dfc4
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: tox entry point to run pep8 1.4.6
......................................................................
tox entry point to run pep8 1.4.6
The Wikimedia CI tests are hardcoded to run pep8==1.4.6. Introduce tox
to let developers easily redefine whatever command they need.
Not using flake8 since the repo does not pass pyflakes and others. But
it will be easy to switch to it later on.
Pin pep8 to 1.4.6 to match the version that has been running on
Wikimedia CI (Ubuntu Precise).
Move content of .pep8 to tox.ini section [pep8]. That is properly
recognized by pep8 1.4.6.
Ignore /.tox
Bug: T55354
Change-Id: I70e4a843dae5a7ebab6485e1abab2b124535f193
---
M .gitignore
D .pep8
A tox.ini
3 files changed, 13 insertions(+), 4 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.gitignore b/.gitignore
index 29cd0f2..ad22c18 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+/.tox
*.bak
*.pyc
logs*
diff --git a/.pep8 b/.pep8
deleted file mode 100644
index 100c9aa..0000000
--- a/.pep8
+++ /dev/null
@@ -1,4 +0,0 @@
-[pep8]
-ignore = E122,E127,E241,E226,E502,W602
-exclude = ./catimages.py,./wiktionary.py,./wiktionary/*,./tests/*,./userinterfaces/*,./commonsdelinker/*,./families/*,./maintenance/*,./pywikibot/*,./externals/*
-max_line_length = 256
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..33bd621
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+skipsdist = True
+envlist = lint
+
+[testenv:lint]
+commands = pep8
+deps = pep8==1.4.6
+
+[pep8]
+ignore = E122,E127,E241,E226,E502,W602
+exclude = ./catimages.py,./wiktionary.py,./wiktionary/*,./tests/*,./userinterfaces/*,./commonsdelinker/*,./families/*,./maintenance/*,./pywikibot/*,./externals/*,./.tox
+max_line_length = 256
--
To view, visit https://gerrit.wikimedia.org/r/242864
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I70e4a843dae5a7ebab6485e1abab2b124535f193
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: Hashar <hashar(a)free.fr>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: updating Vikidia available languages
......................................................................
updating Vikidia available languages
Change-Id: I1c1e1ac51131f36bdd9f5befb46a2e4d9fb8c831
---
M families/vikidia_family.py
1 file changed, 3 insertions(+), 1 deletion(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/families/vikidia_family.py b/families/vikidia_family.py
index 6dc82aa..d3247d9 100644
--- a/families/vikidia_family.py
+++ b/families/vikidia_family.py
@@ -18,9 +18,11 @@
'ca': 'ca.vikidia.org',
'en': 'en.vikidia.org',
'es': 'es.vikidia.org',
+ 'eu': 'eu.vikidia.org',
'fr': 'fr.vikidia.org',
'it': 'it.vikidia.org',
'ru': 'ru.vikidia.org',
+ 'scn': 'scn.vikidia.org',
}
self.namespaces[1] = {
@@ -111,7 +113,7 @@
# Which version of MediaWiki is used? REQUIRED
def version(self, code):
"""Return the version for this family."""
- return '1.24.2'
+ return '1.25.2'
def code2encoding(self, code):
"""Return the encoding for a specific language wiki."""
--
To view, visit https://gerrit.wikimedia.org/r/242800
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1c1e1ac51131f36bdd9f5befb46a2e4d9fb8c831
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/compat
Gerrit-Branch: master
Gerrit-Owner: Linedwell <Linedwell(a)icloud.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>
jenkins-bot has submitted this change and it was merged.
Change subject: updating Vikidia available languages (seems to have been removed)
......................................................................
updating Vikidia available languages (seems to have been removed)
Change-Id: I1fea6e7651bcd16cb3c72f44564c0f25f7152bc5
---
M pywikibot/families/vikidia_family.py
M tests/family_tests.py
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/families/vikidia_family.py b/pywikibot/families/vikidia_family.py
index 5a79642..0a88744 100644
--- a/pywikibot/families/vikidia_family.py
+++ b/pywikibot/families/vikidia_family.py
@@ -14,7 +14,7 @@
name = 'vikidia'
domain = 'vikidia.org'
- codes = ['ca', 'en', 'es', 'fr', 'it', 'ru']
+ codes = ['ca', 'en', 'es', 'eu', 'fr', 'it', 'ru', 'scn']
def protocol(self, code):
"""Return https as the protocol for this family."""
diff --git a/tests/family_tests.py b/tests/family_tests.py
index d98570d..42035ad 100644
--- a/tests/family_tests.py
+++ b/tests/family_tests.py
@@ -48,7 +48,7 @@
self.assertEqual(f.name, name)
self.assertIsInstance(f.languages_by_size, list)
self.assertGreaterEqual(set(f.langs), set(f.languages_by_size))
- if len(f.langs) > 6 and f.name != 'wikimediachapter':
+ if len(f.langs) > 2 and f.name not in ['wikimediachapter', 'vikidia']:
self.assertNotEqual(f.languages_by_size, [])
if isinstance(f, SingleSiteFamily):
self.assertIsNotNone(f.code)
--
To view, visit https://gerrit.wikimedia.org/r/242799
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I1fea6e7651bcd16cb3c72f44564c0f25f7152bc5
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Linedwell <Linedwell(a)icloud.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>