jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/620458 )
Change subject: Revert "Only run cosmetic changes on wikitext pages"
......................................................................
Revert "Only run cosmetic changes on wikitext pages"
This reverts commit 94a3f39a038a87e7516e55a253423609694d5342.
Reason for revert: T260472
Change-Id: Ib6b2672f978ec208b7c051e3409d70e96011872b
---
M pywikibot/page/__init__.py
1 file changed, 9 insertions(+), 7 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index ff9812f..8d7dea7 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1309,7 +1309,7 @@
cc=None, quiet=False, **kwargs):
"""Helper function for save()."""
link = self.title(as_link=True)
- if cc or (cc is None and config.cosmetic_changes):
+ if cc or cc is None and config.cosmetic_changes:
summary = self._cosmetic_changes_hook(summary)
done = self.site.editpage(self, summary=summary, minor=minor,
@@ -1330,18 +1330,20 @@
else the old edit summary.
@rtype: str
"""
- if self.isTalkPage() or self.content_model != 'wikitext' or \
+ if self.isTalkPage() or \
pywikibot.calledModuleName() in config.cosmetic_changes_deny_script:
return summary
family = self.site.family.name
if config.cosmetic_changes_mylang_only:
- cc = ((family == config.family and self.site.lang == config.mylang)
- or self.site.lang in config.cosmetic_changes_enable.get(
- family, []))
+ cc = ((family == config.family
+ and self.site.lang == config.mylang)
+ or family in config.cosmetic_changes_enable
+ and self.site.lang in config.cosmetic_changes_enable[family])
else:
cc = True
- cc = cc and self.site.lang not in config.cosmetic_changes_disable.get(
- family, [])
+ cc = (cc and not
+ (family in config.cosmetic_changes_disable
+ and self.site.lang in config.cosmetic_changes_disable[family]))
if not cc:
return summary
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/620458
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ib6b2672f978ec208b7c051e3409d70e96011872b
Gerrit-Change-Number: 620458
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: Matěj Suchánek <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits