Huji has submitted this change and it was merged.
Change subject: (bug 57164) ignore disambig pages ......................................................................
(bug 57164) ignore disambig pages
Change-Id: I9396b7c0b7cd87958d2b69e6cccc824d646889e3 --- M noreferences.py 1 file changed, 8 insertions(+), 4 deletions(-)
Approvals: Huji: Checked; Looks good to me, approved jenkins-bot: Verified
diff --git a/noreferences.py b/noreferences.py index c56214e..b290edb 100644 --- a/noreferences.py +++ b/noreferences.py @@ -437,6 +437,8 @@ self.generator = generator self.always = always self.site = pywikibot.getSite() + self.comment = i18n.twtranslate(self.site, 'noreferences-add-tag') + self.refR = re.compile('</ref>', re.IGNORECASE) self.referencesR = re.compile('<references.*?/>', re.IGNORECASE) self.referencesTagR = re.compile('<references>.*?</references>', @@ -600,7 +602,7 @@
if self.always: try: - page.put(newText) + page.put(newText, self.comment) except pywikibot.EditConflict: pywikibot.output(u'Skipping %s because of edit conflict' % (page.title(),)) @@ -612,12 +614,10 @@ pywikibot.output(u'Skipping %s (locked page)' % (page.title(),)) else: # Save the page in the background. No need to catch exceptions. - page.put_async(newText) + page.put_async(newText, self.comment) return
def run(self): - comment = i18n.twtranslate(self.site, 'noreferences-add-tag') - pywikibot.setAction(comment)
for page in self.generator: # Show the title of the page we're working on. @@ -638,6 +638,10 @@ pywikibot.output(u"Page %s is locked?!" % page.title(asLink=True)) continue + if page.isDisambig(): + pywikibot.output(u"Page %s is a disambig; skipping." + % page.title(asLink=True)) + continue if pywikibot.getSite().sitename() == 'wikipedia:en' and \ page.isIpEdit(): pywikibot.output(
pywikibot-commits@lists.wikimedia.org