jenkins-bot has submitted this change and it was merged.
Change subject: Move cosmetic_changes from scripts to pywikibot
......................................................................
Move cosmetic_changes from scripts to pywikibot
Bug: T76324
Change-Id: I5685a8e282445ef90a9af74b84cecb0b95d014db
---
R pywikibot/cosmetic_changes.py
M pywikibot/page.py
M tests/isbn_tests.py
3 files changed, 4 insertions(+), 7 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
similarity index 100%
rename from scripts/cosmetic_changes.py
rename to pywikibot/cosmetic_changes.py
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 9c71b95..8d17dc7 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1095,11 +1095,9 @@
self.site.lang in config.cosmetic_changes_disable[family]))
if not cc:
return
- try:
- from scripts.cosmetic_changes import CosmeticChangesToolkit
- except ImportError:
- pywikibot.log(u'Cosmetic changes module not available.')
- return
+
+ # cc depends on page directly and via several other imports
+ from pywikibot.cosmetic_changes import CosmeticChangesToolkit # noqa
old = self.text
pywikibot.log(u'Cosmetic changes for %s-%s enabled.'
% (family, self.site.lang))
diff --git a/tests/isbn_tests.py b/tests/isbn_tests.py
index 4850103..57325f9 100644
--- a/tests/isbn_tests.py
+++ b/tests/isbn_tests.py
@@ -12,8 +12,7 @@
__version__ = '$Id$'
from pywikibot import Bot, Claim, ItemPage
-
-from scripts.cosmetic_changes import CosmeticChangesToolkit, CANCEL_MATCH
+from pywikibot.cosmetic_changes import CosmeticChangesToolkit, CANCEL_MATCH
from scripts.isbn import (
ISBN10, ISBN13, InvalidIsbnException as IsbnExc,
--
To view, visit
https://gerrit.wikimedia.org/r/190715
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5685a8e282445ef90a9af74b84cecb0b95d014db
Gerrit-PatchSet: 17
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Ladsgroup <ladsgroup(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: jenkins-bot <>