jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/342484 )
Change subject: Clean up obsolete code in cosmetic_changes.py
......................................................................
Clean up obsolete code in cosmetic_changes.py
The exception handling is done in CurrentPageBot._save_page().
Change-Id: I082f49c7df2edf8910722910cca20ca486e575fe
---
M scripts/cosmetic_changes.py
1 file changed, 8 insertions(+), 15 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/scripts/cosmetic_changes.py b/scripts/cosmetic_changes.py
index def3673..1fc260f 100644
--- a/scripts/cosmetic_changes.py
+++ b/scripts/cosmetic_changes.py
@@ -27,7 +27,7 @@
"""
#
# (C) xqt, 2009-2013
-# (C) Pywikibot team, 2006-2015
+# (C) Pywikibot team, 2006-2017
#
# Distributed under the terms of the MIT license.
#
@@ -71,20 +71,13 @@
def treat_page(self):
"""Treat page with the cosmetic toolkit."""
- try:
- ccToolkit = cosmetic_changes.CosmeticChangesToolkit.from_page(
- self.current_page, False, self.getOption('ignore'))
- changedText = ccToolkit.change(self.current_page.get())
- if changedText is not False:
- self.put_current(new_text=changedText,
- summary=self.getOption('summary'),
- async=self.getOption('async'))
- except pywikibot.LockedPage:
- pywikibot.output("Page %s is locked?!"
- % self.current_page.title(asLink=True))
- except pywikibot.EditConflict:
- pywikibot.output("An edit conflict has occurred at %s."
- % self.current_page.title(asLink=True))
+ ccToolkit = cosmetic_changes.CosmeticChangesToolkit.from_page(
+ self.current_page, False, self.getOption('ignore'))
+ changedText = ccToolkit.change(self.current_page.get())
+ if changedText is not False:
+ self.put_current(new_text=changedText,
+ summary=self.getOption('summary'),
+ async=self.getOption('async'))
def main(*args):
--
To view, visit
https://gerrit.wikimedia.org/r/342484
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I082f49c7df2edf8910722910cca20ca486e575fe
Gerrit-PatchSet: 2
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Magul <tomasz.magulski(a)gmail.com>
Gerrit-Reviewer: Mpaa <mpaa.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot <>