jenkins-bot merged this change.
[IMPR] parse global args before local args
detached from I4ef9009c91
Change-Id: Ieac88faba37a7caa76f1b3ee49847e5a53dba2a4
---
M scripts/patrol.py
1 file changed, 4 insertions(+), 5 deletions(-)
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 change 467947. To unsubscribe, or for help writing mail filters, visit settings.