jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/286477 )
Change subject: [IMPR] return result of userPut with put_current method ......................................................................
[IMPR] return result of userPut with put_current method
- userPut() returns a boolean whether the page was saved successfully put_current should forward it
Change-Id: Ic7ef86ed75badb1d49e4e365edd43207dba3b159 --- M pywikibot/bot.py 1 file changed, 8 insertions(+), 5 deletions(-)
Approvals: Dalba: Looks good to me, approved jenkins-bot: Verified
diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 2788b86..a17b37a 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -48,7 +48,7 @@ used. """ # -# (C) Pywikibot team, 2008-2016 +# (C) Pywikibot team, 2008-2017 # # Distributed under the terms of the MIT license. # @@ -1641,15 +1641,18 @@ @type ignore_server_errors: bool or None @param kwargs: Additional parameters directly given to L{Bot.userPut}. @type kwargs: dict + @return: whether the page was saved successfully + @rtype: bool """ if ignore_save_related_errors is None: ignore_save_related_errors = self.ignore_save_related_errors if ignore_server_errors is None: ignore_server_errors = self.ignore_server_errors - self.userPut(self.current_page, self.current_page.text, new_text, - ignore_save_related_errors=ignore_save_related_errors, - ignore_server_errors=ignore_server_errors, - **kwargs) + return self.userPut( + self.current_page, self.current_page.text, new_text, + ignore_save_related_errors=ignore_save_related_errors, + ignore_server_errors=ignore_server_errors, + **kwargs)
class AutomaticTWSummaryBot(CurrentPageBot):
pywikibot-commits@lists.wikimedia.org