Xqt has uploaded a new change for review. https://gerrit.wikimedia.org/r/216412
Change subject: [BUGFIX] use site attribute of bot class, remove obsolete dry option ...................................................................... [BUGFIX] use site attribute of bot class, remove obsolete dry option Change-Id: Id729e5f756d214168f69038ab489fdaf450a0b0b --- M scripts/blockreview.py 1 file changed, 24 insertions(+), 33 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/12/216412/1 diff --git a/scripts/blockreview.py b/scripts/blockreview.py index 47b40bf..0356c8b 100755 --- a/scripts/blockreview.py +++ b/scripts/blockreview.py @@ -77,17 +77,9 @@ 'pt': u'Wikipedia:Pedidos a administradores/Discussão de bloqueio', } - def __init__(self, dry=False): - """ - Constructor. - - @param generator: The page generator that determines on which pages - to work on. - @param dry: If True, doesn't do any real changes, but only shows - what would have been changed. - """ + def __init__(self): + """Constructor.""" self.site = pywikibot.Site() - self.dry = dry self.info = None self.parts = None @@ -158,7 +150,7 @@ % self.parts) # some test stuff - if self.site().user() == u'Xqbot': + if self.site.user() == u'Xqbot': testPage = pywikibot.Page(self.site, 'Benutzer:Xqt/Test') test = testPage.get() @@ -270,28 +262,27 @@ # show what was changed pywikibot.showDiff(page.get(), text) pywikibot.output(u'Comment: %s' % comment) - if not self.dry: - if pywikibot.input_yn( - u'Do you want to accept these changes?', - default=False, automatic_quit=False): - page.text = text - try: - # Save the page - page.save(summary=comment, minorEdit=minorEdit, - botflag=botflag) - except pywikibot.LockedPage: - pywikibot.output(u"Page %s is locked; skipping." - % page.title(asLink=True)) - except pywikibot.EditConflict: - pywikibot.output( - u'Skipping %s because of edit conflict' - % (page.title())) - except pywikibot.SpamfilterError as error: - pywikibot.output( - u'Cannot change %s because of spam blacklist entry ' - u'%s' % (page.title(), error.url)) - else: - return True + if pywikibot.input_yn( + u'Do you want to accept these changes?', + default=False, automatic_quit=False): + page.text = text + try: + # Save the page + page.save(summary=comment, minorEdit=minorEdit, + botflag=botflag) + except pywikibot.LockedPage: + pywikibot.output(u"Page %s is locked; skipping." + % page.title(asLink=True)) + except pywikibot.EditConflict: + pywikibot.output( + u'Skipping %s because of edit conflict' + % (page.title())) + except pywikibot.SpamfilterError as error: + pywikibot.output( + u'Cannot change %s because of spam blacklist entry ' + u'%s' % (page.title(), error.url)) + else: + return True def main(*args): -- To view, visit https://gerrit.wikimedia.org/r/216412 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id729e5f756d214168f69038ab489fdaf450a0b0b Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt <i...@gno.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits