jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/713685 )
Change subject: add_text: Support -major option ......................................................................
add_text: Support -major option
Ocasionally, it comes handle to save major edits via add_text. Add an option to support that.
Change-Id: Ia9efb3b4080ae311204978bc48f877ebccd5a8c8 --- M scripts/add_text.py 1 file changed, 6 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/add_text.py b/scripts/add_text.py index 6f5ba3c..63cdfd7 100755 --- a/scripts/add_text.py +++ b/scripts/add_text.py @@ -21,6 +21,8 @@ -always If used, the bot won't ask if it should add the specified text
+-major If used, the edit will be saved without the "minor edit" flag + -talkpage Put the text onto the talk page instead -talk
@@ -87,6 +89,7 @@ 'summary': '', 'up': False, 'always': False, + 'minor': True, 'talk_page': False, 'reorder': True, 'regex_skip_url': '', @@ -361,7 +364,7 @@ text = textlib.add_text(text, self.opt.text, site=self.current_page.site)
- self.put_current(text, summary=self.opt.summary) + self.put_current(text, summary=self.opt.summary, minor=self.opt.minor)
def main(*argv: Tuple[str, ...]) -> None: @@ -419,6 +422,8 @@ args['reorder'] = False elif option == '-excepturl': args['regex_skip_url'] = value + elif option == '-major': + args['minor'] = False else: raise ValueError("Argument '{}' is unrecognized".format(option))