jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55187) archivebot.py: proper handling of command line args ......................................................................
(bug 55187) archivebot.py: proper handling of command line args
"-family:" is now effective even when "--lang" is not provided. The first positional arg (script name) is now ignored.
(Follow-up to I97b14b21f3c4c73183f85473926e0b204c4f1abd)
Change-Id: Ia747df50b5736805b0cb1bbfdc2f5d1db180252a (cherry picked from commit 0da738ee7d39433a79b18dcc6e40af8b07dc7e14) --- M archivebot.py 1 file changed, 6 insertions(+), 4 deletions(-)
Approvals: Merlijn van Deen: Looks good to me, approved jenkins-bot: Verified
diff --git a/archivebot.py b/archivebot.py index 9c5603f..3146732 100644 --- a/archivebot.py +++ b/archivebot.py @@ -701,13 +701,15 @@ force = False
if options.lang: - Site = pywikibot.getSite(options.lang) - language = Site.language() + pywikibot.default_code = options.lang + + Site = pywikibot.getSite() + language = Site.language()
if options.simulate: pywikibot.simulate = True
- if not args: + if not args or len(args) <= 1: pywikibot.output(u'NOTE: you must specify a template to run the bot') pywikibot.showHelp('archivebot') return @@ -715,7 +717,7 @@ #query site for original months name and create convenience look-up dictionaries Months.updateMonths(site=Site)
- for a in args: + for a in args[1:]: pagelist = [] if not options.filename and not options.pagename: #for pg in pywikibot.Page(Site,a).getReferences(follow_redirects=False,onlyTemplateInclusion=True):