jenkins-bot submitted this change.
Re-apply "Only run cosmetic changes on wikitext pages"
This reverts commit 33aebee955995c1efd477a885d28db4995d171e4.
Bug: T260489
Change-Id: I3ecb38eb332f34f680e90071d2bcf38ceb18c5ea
---
M pywikibot/page/__init__.py
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/pywikibot/page/__init__.py b/pywikibot/page/__init__.py
index 2610429..6ccc83b 100644
--- a/pywikibot/page/__init__.py
+++ b/pywikibot/page/__init__.py
@@ -1308,7 +1308,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,
@@ -1329,20 +1329,18 @@
else the old edit summary.
@rtype: str
"""
- if self.isTalkPage() or \
+ if self.isTalkPage() or self.content_model != 'wikitext' 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 family in config.cosmetic_changes_enable
- and self.site.lang in config.cosmetic_changes_enable[family])
+ cc = ((family == config.family and self.site.lang == config.mylang)
+ or self.site.lang in config.cosmetic_changes_enable.get(
+ family, []))
else:
cc = True
- cc = (cc and not
- (family in config.cosmetic_changes_disable
- and self.site.lang in config.cosmetic_changes_disable[family]))
+ cc = cc and self.site.lang not in config.cosmetic_changes_disable.get(
+ family, [])
if not cc:
return summary
To view, visit change 622786. To unsubscribe, or for help writing mail filters, visit settings.