Xqt has submitted this change and it was merged.
Change subject: archivebot.py: fix template name comparison + loop refactoring ......................................................................
archivebot.py: fix template name comparison + loop refactoring
Change-Id: I9b6c156f63300269226b54f21107fd9050d72350 --- M scripts/archivebot.py 1 file changed, 2 insertions(+), 4 deletions(-)
Approvals: Xqt: Verified; Looks good to me, approved
diff --git a/scripts/archivebot.py b/scripts/archivebot.py index 8c29557..345c727 100644 --- a/scripts/archivebot.py +++ b/scripts/archivebot.py @@ -532,15 +532,13 @@
def loadConfig(self): pywikibot.output(u'Looking for: {{%s}} in %s' % (self.tpl, self.Page)) - found = False for tpl in self.Page.templatesWithParams(): - if tpl[0].title() == self.tpl: + if tpl[0] == pywikibot.Page(Site, self.tpl, ns=10): for param in tpl[1]: item, value = param.split('=', 1) self.set(item.strip(), value.strip()) - found = True break - if not found: + else: raise MissingConfigError(u'Missing or malformed template') if not self.get('algo', ''): raise MissingConfigError(u'Missing algo')
pywikibot-commits@lists.wikimedia.org