jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/636427 )
Change subject: [IMPR] use put_current instead of userPut to write the page
......................................................................
[IMPR] use put_current instead of userPut to write the page
Also remove exception handling which is done by BaseBot._save_page
already because CurrentPageBot ignores save related errors and
does not raise the exception.
Change-Id: I096e972fda42d7daa832fb52d5e50c467cd6e593
---
M scripts/noreferences.py
1 file changed, 2 insertions(+), 15 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/noreferences.py b/scripts/noreferences.py
index fec70ba..8da4116 100755
--- a/scripts/noreferences.py
+++ b/scripts/noreferences.py
@@ -728,25 +728,12 @@
try:
text = page.text
except pywikibot.LockedPage:
- pywikibot.warning('Page {0} is locked?!'
+ pywikibot.warning('Page {} is locked?!'
.format(page.title(as_link=True)))
return
if self.lacksReferences(text):
- newText = self.addReferences(text)
- try:
- self.userPut(
- page, page.text, newText, summary=self.comment)
- except pywikibot.EditConflict:
- pywikibot.warning('Skipping {0} because of edit conflict'
- .format(page.title(as_link=True)))
- except pywikibot.SpamblacklistError as e:
- pywikibot.warning(
- 'Cannot change {0} because of blacklist entry {1}'
- .format(page.title(as_link=True), e.url))
- except pywikibot.LockedPage:
- pywikibot.warning('Skipping {0} (locked page)'
- .format(page.title(as_link=True)))
+ self.put_current(self.addReferences(text), summary=self.comment)
def main(*args) -> None:
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/636427
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: I096e972fda42d7daa832fb52d5e50c467cd6e593
Gerrit-Change-Number: 636427
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged