jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/469433 )
Change subject: Removed unused vars/parameters from daemonize.py and data/api.py ......................................................................
Removed unused vars/parameters from daemonize.py and data/api.py
According to vulture the code was not being used. I removed it and ran tests. As far as I can see I did not break anything. But it is my first commit so it might be good if someone else ran tests on it. I also removed a superfluous error from data/api.py and removed the per-file-ignores that ignored the error.
Bug: T203395 Change-Id: Id75da257c2f3e3be43b98e749f027258a1a576e1 --- M pywikibot/daemonize.py M pywikibot/data/api.py M tox.ini 3 files changed, 8 insertions(+), 9 deletions(-)
Approvals: Xqt: Looks good to me, but someone else must approve D3r1ck01: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/daemonize.py b/pywikibot/daemonize.py index 03a1532..7fe1c04 100644 --- a/pywikibot/daemonize.py +++ b/pywikibot/daemonize.py @@ -11,10 +11,13 @@ import os import sys
+from pywikibot.tools import deprecated_args + is_daemon = False
-def daemonize(close_fd=True, chdir=True, write_pid=False, redirect_std=None): +@deprecated_args(write_pid=None) +def daemonize(close_fd=True, chdir=True, redirect_std=None): """ Daemonize the current process.
@@ -25,8 +28,6 @@ @type close_fd: bool @param chdir: Change the current working directory to / @type chdir: bool - @param write_pid: Write the pid to sys.argv[0] + '.pid' - @type write_pid: bool @param redirect_std: Filename to redirect stdout and stdin to @type redirect_std: str """ @@ -54,7 +55,6 @@ os.dup2(1, 2) if chdir: os.chdir('/') - return else: # Write out the pid path = os.path.basename(sys.argv[0]) + '.pid' diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py index afb997a..64223ce 100644 --- a/pywikibot/data/api.py +++ b/pywikibot/data/api.py @@ -39,7 +39,7 @@ ) from pywikibot.tools import ( MediaWikiVersion, deprecated, itergroup, ip, PY2, PYTHON_VERSION, - getargspec, UnicodeType + getargspec, UnicodeType, remove_last_args ) from pywikibot.tools.formatter import color_format
@@ -3242,11 +3242,10 @@
"""Supply getCookie() method to use API interface."""
- def getCookie(self, remember=True, captchaId=None, captchaAnswer=None): + @remove_last_args(arg_names=['remember, captchaId, captchaAnswer']) + def getCookie(self): """Login to the site.
- Parameters are all ignored. - Note, this doesn't actually return or do anything with cookies. The threadedhttp module takes care of all the cookie stuff, this just has a legacy name for now and should be renamed in the diff --git a/tox.ini b/tox.ini index 2db36d6..fa259eb 100644 --- a/tox.ini +++ b/tox.ini @@ -154,7 +154,7 @@ pywikibot/compat/catlib.py : N803 pywikibot/compat/query.py: N802 pywikibot/cosmetic_changes.py : N803, N806, N802 - pywikibot/data/api.py : N803, N806, N802 + pywikibot/data/api.py : N806, N802 pywikibot/data/sparql.py: N802 pywikibot/date.py : N803, N806, N802 pywikibot/echo.py: N802
pywikibot-commits@lists.wikimedia.org