Merlijn van Deen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/93103


Change subject: Fixup 920ba1f - make -help work again
......................................................................

Fixup 920ba1f - make -help work again

We need to explicitly use pywikibot.argvu, or else two
copies of this array will be floating around (pywikibot.argvu
and pywikibot.bot.argvu). Setting it explicitly on pywikibot
makes sure the second one doesn't exist. Furthermore, make sure
the script name parser uses the working argvu.
Lastly, make the generic argument parser call pywikibot.argvu
instead of re-importing argvu locally.

Change-Id: I35ce3582bb74037d517a714d9d5f467d6b868bdb
---
M pywikibot/bot.py
1 file changed, 3 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/03/93103/1

diff --git a/pywikibot/bot.py b/pywikibot/bot.py
index bb793c8..ca06ce0 100644
--- a/pywikibot/bot.py
+++ b/pywikibot/bot.py
@@ -40,7 +40,7 @@
                       % config.userinterface,
                       fromlist=['UI'])
 ui = uiModule.UI()
-argvu = ui.argvu()
+pywikibot.argvu = ui.argvu()
 
 
 # Logging module configuration
@@ -501,7 +501,7 @@
 
     """
     # get commandline arguments
-    called = argvu[0].strip()
+    called = pywikibot.argvu[0].strip()
     if ".py" in called:  # could end with .pyc, .pyw, etc. on some platforms
         # clip off the '.py?' filename extension
         called = called[:called.rindex('.py')]
@@ -523,8 +523,7 @@
     if not args:
         # it's the version in pywikibot.__init__ that is changed by scripts,
         # not the one in pywikibot.bot.
-        from pywikibot import argvu
-        args = argvu[1:]
+        args = pywikibot.argvu[1:]
     # get the name of the module calling this function. This is
     # required because the -help option loads the module's docstring and 
because
     # the module name will be used for the filename of the log.

-- 
To view, visit https://gerrit.wikimedia.org/r/93103
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35ce3582bb74037d517a714d9d5f467d6b868bdb
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Merlijn van Deen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to