jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
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(-)

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))


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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ia9efb3b4080ae311204978bc48f877ebccd5a8c8
Gerrit-Change-Number: 713685
Gerrit-PatchSet: 1
Gerrit-Owner: Urbanecm <martin.urbanec@wikimedia.cz>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged