jenkins-bot merged this change.
[IMPR] Equalize parameters of Page.save, Page.put, Page.put_async
Bug: T193490
Change-Id: I43ae8f51ea7e5e1dab71f2477b17f51e4ecc284d
---
M pywikibot/page.py
M scripts/checkimages.py
M scripts/editarticle.py
M scripts/welcome.py
4 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/pywikibot/page.py b/pywikibot/page.py
index 6957e70..0766f63 100644
--- a/pywikibot/page.py
+++ b/pywikibot/page.py
@@ -1334,9 +1334,10 @@
return summary
@deprecate_arg('async', 'asynchronous') # T106230
- @deprecated_args(comment='summary')
- def put(self, newtext, summary=u'', watchArticle=None, minorEdit=True,
- botflag=None, force=False, asynchronous=False, callback=None, **kwargs):
+ @deprecated_args(comment='summary', watchArticle='watch',
+ minorEdit='minor')
+ def put(self, newtext, summary=None, watch=None, minor=True, botflag=None,
+ force=False, asynchronous=False, callback=None, **kwargs):
"""
Save the page with the contents of the first argument as the text.
@@ -1349,14 +1350,14 @@
"""
self.text = newtext
- self.save(summary=summary, watch=watchArticle, minor=minorEdit,
- botflag=botflag, force=force, asynchronous=asynchronous,
- callback=callback, **kwargs)
+ self.save(summary=summary, watch=watch, minor=minor, botflag=botflag,
+ force=force, asynchronous=asynchronous, callback=callback,
+ **kwargs)
- @deprecated_args(comment='summary')
- def put_async(self, newtext, summary=u'', watchArticle=None,
- minorEdit=True, botflag=None, force=False, callback=None,
- **kwargs):
+ @deprecated_args(comment='summary', watchArticle='watch',
+ minorEdit='minor')
+ def put_async(self, newtext, summary=None, watch=None, minor=True,
+ botflag=None, force=False, callback=None, **kwargs):
"""
Put page on queue to be saved to wiki asynchronously.
@@ -1365,8 +1366,8 @@
the same as for .put(). This version is maintained solely for
backwards-compatibility.
"""
- self.put(newtext, summary=summary, watchArticle=watchArticle,
- minorEdit=minorEdit, botflag=botflag, force=force,
+ self.put(newtext, summary=summary, watch=watch,
+ minor=minor, botflag=botflag, force=force,
asynchronous=True, callback=callback, **kwargs)
def watch(self, unwatch=False):
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index c6e5456..a398533 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -747,7 +747,7 @@
return
try:
- self.talk_page.put(newText, summary=commentox, minorEdit=False)
+ self.talk_page.put(newText, summary=commentox, minor=False)
except pywikibot.LockedPage:
pywikibot.output(u'Talk page blocked, skip.')
else:
@@ -1075,7 +1075,7 @@
else:
# Adding the log
another_page.put(text_get + rep_text, summary=com, force=True,
- minorEdit=False)
+ minor=False)
pywikibot.output(u"...Reported...")
return reported
diff --git a/scripts/editarticle.py b/scripts/editarticle.py
index a33cb8c..b7077ac 100755
--- a/scripts/editarticle.py
+++ b/scripts/editarticle.py
@@ -102,8 +102,8 @@
comment = i18n.twtranslate(self.site, 'editarticle-edit',
{'description': changes})
try:
- self.page.put(new, summary=comment, minorEdit=False,
- watchArticle=self.options.watch)
+ self.page.put(new, summary=comment, minor=False,
+ watch=self.options.watch)
except pywikibot.EditConflict:
self.handle_edit_conflict(new)
else:
diff --git a/scripts/welcome.py b/scripts/welcome.py
index cc78f4e..eaf1839 100755
--- a/scripts/welcome.py
+++ b/scripts/welcome.py
@@ -613,7 +613,7 @@
com = i18n.twtranslate(self.site, 'welcome-bad_username')
if rep_text != '':
rep_page.put(text_get + rep_text, summary=com, force=True,
- minorEdit=True)
+ minor=True)
showStatus(5)
pywikibot.output(u'Reported')
self.BAQueue = []
@@ -776,7 +776,7 @@
try:
# append welcomed, welcome_count++
ustp.put(welcome_text, welcome_comment,
- minorEdit=False)
+ minor=False)
welcomed_count += 1
self._totallyCount += 1
self.welcomed_users.append(users)
To view, visit change 430062. To unsubscribe, visit settings.