jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/473747 )
Change subject: [bugfix] Disable empty sections cc in userspace
......................................................................
[bugfix] Disable empty sections cc in userspace
User sandbox can contain multiple empty sections of newly prepared
article stub. But users don't use nobots/in-use templates
in their userspace, therefore bots should not remove these empty
sections from the page.
Change-Id: I7a588887b24954ebcb8a8a5295b4b84929c4c2ea
---
M pywikibot/cosmetic_changes.py
1 file changed, 4 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 01fbcdf..7b389a4 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -662,6 +662,10 @@
def removeEmptySections(self, text):
"""Cleanup empty sections."""
+ # userspace contains article stubs without nobots/in use templates
+ if self.namespace == 2:
+ return text
+
skippings = ['comment', 'category']
skip_regexes = _get_regexes(skippings, self.site)
# site defined templates
--
To view, visit https://gerrit.wikimedia.org/r/473747
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I7a588887b24954ebcb8a8a5295b4b84929c4c2ea
Gerrit-Change-Number: 473747
Gerrit-PatchSet: 3
Gerrit-Owner: Dvorapa <[email protected]>
Gerrit-Reviewer: D3r1ck01 <[email protected]>
Gerrit-Reviewer: Dalba <[email protected]>
Gerrit-Reviewer: Dvorapa <[email protected]>
Gerrit-Reviewer: Framawiki <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: Zhuyifei1999 <[email protected]>
Gerrit-Reviewer: jenkins-bot (75)
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits