Xqt submitted this change.

View Change

Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
[IMPR] Reword add_text argument descriptions to be more succinct.

Also position add_text -help arguments above '&params;'

Change-Id: I7bdb0d52facaa93eac41feb11b438f0cb3423af9
M scripts/add_text.py
M tests/add_text_tests.py
2 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/scripts/add_text.py b/scripts/add_text.py
index b8b2e0e..f221e39 100755
--- a/scripts/add_text.py
+++ b/scripts/add_text.py
@@ -1,22 +1,18 @@
-This is a Bot to add text to the top or bottom of a page.
+Append text to the top or bottom of a page.

By default this adds the text to the bottom above the categories and interwiki.

-These command line parameters can be used to specify which pages to work on:
+Use the following command line parameters to specify what to add:

+-text Text to append. "\n" are interpreted as newlines.

-Furthermore, the following command line parameters are supported:
+-textfile Path to a file with text to append

--text Define what text to add. "\n" are interpreted as newlines.
+-summary Change summary to use

--textfile Define a texfile name which contains the text to add
--summary Define the summary to use
--up If used, put the text at the top of the page
+-up Append text to the top of the page rather than the bottom

-create Create the page if necessary. Note that talk pages are
created already without of this option.
@@ -31,13 +27,16 @@
-talkpage Put the text onto the talk page instead

--excepturl Use the html page as text where you want to see if there's
- the text, not the wiki-page.
+-excepturl Skip pages with a url that matches this regular expression

--noreorder Avoid reordering cats and interwiki
+-noreorder Place the text beneath the categories and interwiki

+Furthermore, the following can be used to specify which pages to process...

1. Append 'hello world' to the bottom of the sandbox:

@@ -93,7 +92,6 @@
'-excepturl': 'What url pattern should we skip?',

docuReplacements = {'&params;': pagegenerators.parameterHelp} # noqa: N816

@@ -199,12 +197,13 @@
generator_factory: pagegenerators.GeneratorFactory
- Parses our arguments and provide a named tuple with their values.
+ Parses our arguments and provide a dictionary with their values.

:param argv: input arguments to be parsed
- :param generator_factory: factory that will determine the page to edit
+ :param generator_factory: factory that will determine what pages to
+ process
:return: dictionary with our parsed arguments
- :raise ValueError: invalid arguments received
+ :raise ValueError: if we receive invalid arguments
args = dict(DEFAULT_ARGS)
argv = pywikibot.handle_args(argv)
diff --git a/tests/add_text_tests.py b/tests/add_text_tests.py
index adbfe21..0e7bc62 100755
--- a/tests/add_text_tests.py
+++ b/tests/add_text_tests.py
@@ -1,5 +1,5 @@
-"""Test add_text bot module."""
+"""Test add_text script."""
# (C) Pywikibot team, 2016-2022
@@ -29,9 +29,9 @@
return page

-class TestAdding(TestCase):
+class TestAddTextScript(TestCase):

- """Test adding text."""
+ """Test add_text script."""

family = 'wikipedia'
code = 'en'

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I7bdb0d52facaa93eac41feb11b438f0cb3423af9
Gerrit-Change-Number: 785119
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: Damian <atagar1@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged