jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/467947 )

Change subject: [IMPR] parse global args before local args
......................................................................

[IMPR] parse global args before local args

detached from I4ef9009c91

Change-Id: Ieac88faba37a7caa76f1b3ee49847e5a53dba2a4
---
M scripts/patrol.py
1 file changed, 4 insertions(+), 5 deletions(-)

Approvals:
  D3r1ck01: Looks good to me, but someone else must approve
  Mpaa: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/scripts/patrol.py b/scripts/patrol.py
index e72e7ad..6cf8b76 100755
--- a/scripts/patrol.py
+++ b/scripts/patrol.py
@@ -446,11 +446,13 @@
     recentchanges = False
     newpages = False
     repeat = False
-    gen_factory = pagegenerators.GeneratorFactory()
     options = {}

     # Parse command line arguments
-    for arg in pywikibot.handle_args(args):
+    local_args = pywikibot.handle_args(args)
+    site = pywikibot.Site()
+    gen_factory = pagegenerators.GeneratorFactory(site)
+    for arg in local_args:
         if arg.startswith('-ask'):
             options['ask'] = True
         elif arg.startswith('-autopatroluserns'):
@@ -475,9 +477,6 @@
                     m = arg.split(':')
                     options[m[0]] = m[1]

-    site = pywikibot.Site()
-    site.login()
-
     if usercontribs:
         user = pywikibot.User(site, usercontribs)
         if user.isAnonymous() or user.isRegistered():

--
To view, visit https://gerrit.wikimedia.org/r/467947
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.wikimedia.org/r/settings

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieac88faba37a7caa76f1b3ee49847e5a53dba2a4
Gerrit-Change-Number: 467947
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Mpaa <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits

Reply via email to