jenkins-bot merged this change.

View Change

Approvals: D3r1ck01: Looks good to me, but someone else must approve Mpaa: Looks good to me, approved jenkins-bot: Verified
[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.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieac88faba37a7caa76f1b3ee49847e5a53dba2a4
Gerrit-Change-Number: 467947
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <alangiderick@gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb@gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: jenkins-bot (75)