jenkins-bot submitted this change.

View Change

Approvals: Matěj Suchánek: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
[IMPR] Remove _replace_sync_callback in

There is no reason to have a callback function for synchroneous
page save which in result does just nothing except preventing
showing the page save message and does a bulk save message
every 50 titles. Use the default Bot behaviour instead.

Change-Id: Icf4fa26727207aa7d52818be019055c0a42acf89
M scripts/
1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/scripts/ b/scripts/
index e9f1d68..321317b 100755
--- a/scripts/
+++ b/scripts/
@@ -666,7 +666,7 @@
new_text = self.apply_replacements(original_text, set(), page=page)
return new_text

- def _log_changes(self, page, err):
+ def _replace_async_callback(self, page, err):
"""Log changed titles for display."""
# This is an async put callback
if not isinstance(err, Exception):
@@ -676,16 +676,6 @@

- def _replace_async_callback(self, page, err):
- """Callback for asynchronous page edit."""
- self._log_changes(page, err)
- def _replace_sync_callback(self, page, err):
- """Callback for synchronous page edit."""
- self._log_changes(page, err)
- if isinstance(err, Exception):
- raise err
def generate_summary(self, applied_replacements):
"""Generate a summary message for the replacements."""
# all replacements which are merged into the default message
@@ -816,15 +806,7 @@

if self.getOption('always') and new_text != original_text:, original_text, new_text, applied,
- show_diff=False, quiet=True,
- callback=self._replace_sync_callback,
- asynchronous=False)
- if self._pending_processed_titles.qsize() > 50:
- while not self._pending_processed_titles.empty():
- proc_title, res = self._pending_processed_titles.get()
- pywikibot.output('Page {0}{1} saved'
- .format(proc_title,
- '' if res else ' not'))
+ show_diff=False, asynchronous=False)

def save(self, page, oldtext, newtext, applied, **kwargs):
"""Save the given page."""

To view, visit change 591940. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Icf4fa26727207aa7d52818be019055c0a42acf89
Gerrit-Change-Number: 591940
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <>
Gerrit-Reviewer: D3r1ck01 <>
Gerrit-Reviewer: Magul <>
Gerrit-Reviewer: Matěj Suchánek <>
Gerrit-Reviewer: Xqt <>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged