John Vandenberg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/179777
Change subject: Unused parameters
......................................................................
Unused parameters
Note they are unused with NotImplemented when they might be part of
a public API, and instruct pylint to ignore them.
Also a classmethod in commonscat was using 'self' instead of 'cls'.
Change-Id: I57f2162e70e3b28c07bdbf1a947566ccb6f075cf
---
M scripts/archivebot.py
M scripts/commonscat.py
M scripts/featured.py
M scripts/replace.py
M scripts/script_wui.py
5 files changed, 11 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/77/179777/1
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 2342d55..e0e607e 100644
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -210,13 +210,13 @@
"""Class building a UTC tzinfo object."""
- def utcoffset(self, dt):
+ def utcoffset(self, dt): # pylint: disable=unused-argument
return ZERO
- def tzname(self, dt):
+ def tzname(self, dt): # pylint: disable=unused-argument
return 'UTC'
- def dst(self, dt):
+ def dst(self, dt): # pylint: disable=unused-argument
return ZERO
def __repr__(self):
diff --git a/scripts/commonscat.py b/scripts/commonscat.py
index 1a970e3..a00f9ee 100755
--- a/scripts/commonscat.py
+++ b/scripts/commonscat.py
@@ -268,7 +268,7 @@
self.addCommonscat(page)
@classmethod
- def getCommonscatTemplate(self, code=None):
+ def getCommonscatTemplate(cls, code=None):
"""Get the template name of a site. Expects the site code.
Return as tuple containing the primary template and it's alternatives
@@ -357,7 +357,7 @@
def changeCommonscat(self, page=None, oldtemplate=u'', oldcat=u'',
newtemplate=u'', newcat=u'', linktitle=u'',
- description=u''):
+ description=NotImplemented): # pylint:
disable=unused-argument
""" Change the current commonscat template and target. """
if oldcat == '3=S' or linktitle == '3=S':
return # TODO: handle additional param on de-wiki
@@ -533,8 +533,6 @@
generator = None
checkcurrent = False
always = False
- ns = []
- ns.append(14)
# Process global args and prepare generator args parser
local_args = pywikibot.handle_args(args)
@@ -561,7 +559,7 @@
pagegenerators.ReferringPageGenerator(
pywikibot.Page(pywikibot.Site(),
u'Template:' + primaryCommonscat),
- onlyTemplateInclusion=True), ns)
+ onlyTemplateInclusion=True), [14])
if not generator:
generator = genFactory.getCombinedGenerator()
diff --git a/scripts/featured.py b/scripts/featured.py
index 125076e..8f2ad83 100644
--- a/scripts/featured.py
+++ b/scripts/featured.py
@@ -86,7 +86,7 @@
yield article
-def BACK(site, name, hide):
+def BACK(site, name, hide): # pylint: disable=unused-argument
p = pywikibot.Page(site, name, ns=10)
return [page for page in p.getReferences(follow_redirects=False,
onlyTemplateInclusion=True)]
@@ -109,7 +109,7 @@
# not implemented yet
-def TMPL(site, name, hide):
+def TMPL(site, name, hide): # pylint: disable=unused-argument
return
diff --git a/scripts/replace.py b/scripts/replace.py
index 7c6809f..b5e1a2a 100755
--- a/scripts/replace.py
+++ b/scripts/replace.py
@@ -493,8 +493,9 @@
def doReplacements(self, original_text):
return self.apply_replacements(original_text, set())
- def count_changes(self, page, err):
+ def count_changes(self, page, err): # pylint: disable=unused-argument
"""Count succesfully changed pages."""
+ # This is an async put callback
if not isinstance(err, Exception):
self.changed_pages += 1
diff --git a/scripts/script_wui.py b/scripts/script_wui.py
index a2dd6b4..65d7148 100755
--- a/scripts/script_wui.py
+++ b/scripts/script_wui.py
@@ -209,7 +209,7 @@
# Define a function for the thread
-def main_script(page, rev=None, params=None):
+def main_script(page, rev=None, params=NotImplemented): # pylint:
disable=unused-argument
"""Main thread."""
#
http://opensourcehacker.com/2011/02/23/temporarily-capturing-python-logging-output-to-a-string-buffer/
# https://docs.python.org/release/2.6/library/logging.html
--
To view, visit https://gerrit.wikimedia.org/r/179777
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I57f2162e70e3b28c07bdbf1a947566ccb6f075cf
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits