jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/820889 )
Change subject: [IMPR] use User:MiszaBot/config as default template
......................................................................
[IMPR] use User:MiszaBot/config as default template
Change-Id: I697a73736f21f7947b99403877d2f16fbe7f665b
---
M scripts/archivebot.py
1 file changed, 14 insertions(+), 13 deletions(-)
Approvals:
Matěj Suchánek: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/archivebot.py b/scripts/archivebot.py
index 8b3100d..c2bf860 100755
--- a/scripts/archivebot.py
+++ b/scripts/archivebot.py
@@ -1,18 +1,19 @@
#!/usr/bin/python3
-"""
-archivebot.py - discussion page archiving bot.
+"""archivebot.py - discussion page archiving bot.
usage:
- python pwb.py archivebot [OPTIONS] TEMPLATE_PAGE
+ python pwb.py archivebot [OPTIONS] [TEMPLATE_PAGE]
-Bot examines backlinks (Special:WhatLinksHere) to TEMPLATE_PAGE.
-Then goes through all pages (unless a specific page specified using options)
-and archives old discussions. This is done by breaking a page into threads,
-then scanning each thread for timestamps. Threads older than a specified
-threshold are then moved to another page (the archive), which can be named
-either basing on the thread's name or then name can contain a counter which
-will be incremented when the archive reaches a certain size.
+Several TEMPLATE_PAGE templates can be given at once. Default is
+`User:MiszaBot/config`. Bot examines backlinks (Special:WhatLinksHere)
+to all TEMPLATE_PAGE templates. Then goes through all pages (unless a
+specific page specified using options) and archives old discussions.
+This is done by breaking a page into threads, then scanning each thread
+for timestamps. Threads older than a specified threshold are then moved
+to another page (the archive), which can be named either basing on the
+thread's name or then name can contain a counter which will be
+incremented when the archive reaches a certain size.
Transcluded template may contain the following parameters:
@@ -891,9 +892,9 @@
return
if not templates:
- pywikibot.bot.suggest_help(
- additional_text='No template was specified.')
- return
+ templates = ['User:MiszaBot/config']
+ pywikibot.info('No template was specified, using default {{{{{}}}}}.'
+ .format(templates[0]))
for template_name in templates:
tmpl = pywikibot.Page(site, template_name, ns=10)
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/820889
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I697a73736f21f7947b99403877d2f16fbe7f665b
Gerrit-Change-Number: 820889
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Whym <whym(a)whym.org>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged