jenkins-bot has submitted this change and it was merged.
Change subject: Allow -page arg to be handled by pagegenerators ......................................................................
Allow -page arg to be handled by pagegenerators
Change-Id: I61f786509afb4c352762c8ebd1cffd34b67a5cfe --- M scripts/add_text.py 1 file changed, 1 insertion(+), 12 deletions(-)
Approvals: Ricordisamoa: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py index a9489dc..20a0d56 100644 --- a/scripts/add_text.py +++ b/scripts/add_text.py @@ -13,8 +13,6 @@
Furthermore, the following command line parameters are supported:
--page Use a page as generator - -talkpage Put the text onto the talk page instead the generated on -talk
@@ -291,7 +289,6 @@ addText = None regexSkip = None regexSkipUrl = None - generator = None always = False textfile = None talkPage = False @@ -323,13 +320,6 @@ summary = pywikibot.input(u'What summary do you want to use?') else: summary = arg[9:] - elif arg.startswith('-page'): - if len(arg) == 5: - generator = [pywikibot.Page( - pywikibot.Site(), - pywikibot.input(u'What page do you want to use?'))] - else: - generator = [pywikibot.Page(pywikibot.Site(), arg[6:])] elif arg.startswith('-excepturl'): if len(arg) == 10: regexSkipUrl = pywikibot.input(u'What text should I skip?') @@ -353,8 +343,7 @@ if textfile and not addText: with codecs.open(textfile, 'r', config.textfile_encoding) as f: addText = f.read() - if not generator: - generator = genFactory.getCombinedGenerator() + generator = genFactory.getCombinedGenerator() if not generator: pywikibot.showHelp() return
pywikibot-commits@lists.wikimedia.org