Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/776324 )
Change subject: [doc] Add outdated scripts to sphinx docs ......................................................................
[doc] Add outdated scripts to sphinx docs
- add outdated scripts to sphinx docs - add utilities scripts without members as description ans usage documentation
Change-Id: I72a446f26fe9dcac0d4b7c3da98a03c211e9ab4d --- M CREDITS.rst M docs/index.rst M docs/scripts/archive.rst M docs/scripts/index.rst A docs/scripts/outdated.rst C docs/utilities/scripts.rst R docs/utilities/scripts_ref.rst M pwb.py M pywikibot/page/_filepage.py M pywikibot/scripts/__init__.py M pywikibot/scripts/shell.py M scripts/archive/__init__.py 12 files changed, 217 insertions(+), 20 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/CREDITS.rst b/CREDITS.rst index 6d2a629..685b6a7 100644 --- a/CREDITS.rst +++ b/CREDITS.rst @@ -269,6 +269,7 @@ Robert Leverington Rob W.W. Hooft Rotem Liss + Rua Russell Blau
S diff --git a/docs/index.rst b/docs/index.rst index 437704c..927ad30 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,18 +20,19 @@ ``python`` at the CMD or shell prompt.
Python 3.5.3 or higher is currently required to run the bot, but Python 3.6 -or higher is recommended. +or higher is recommended. Python 3.5 support will be dropped with Python 8.
Pywikibot and this documentation are licensed under the :ref:`MIT license`; manual pages on mediawiki.org are licensed under the `CC-BY-SA 3.0`_ license.
-See also: `Pywikibot Manual`_ at https://www.mediawiki.org +.. seealso:: `Pywikibot Manual`_ at https://www.mediawiki.org
Framework Modules Overview -------------------------- .. image:: framework.png + :alt: Framework modules dependency network
For bot users: @@ -41,7 +42,7 @@ :maxdepth: 1
installation - utilities/index + utilities/scripts scripts/index global_options faq @@ -54,10 +55,8 @@ .. toctree:: :maxdepth: 1
- installation library_usage recipes - getting_help api_ref/index
For framework developers: @@ -66,6 +65,7 @@ .. toctree:: :maxdepth: 1
+ utilities/scripts_ref scripts_ref/scripts.maintenance scripts_ref/index
diff --git a/docs/scripts/archive.rst b/docs/scripts/archive.rst index f2a9ca6..70a929b 100644 --- a/docs/scripts/archive.rst +++ b/docs/scripts/archive.rst @@ -2,6 +2,7 @@ ================
.. automodule:: scripts.archive +.. seealso:: :ref:`Outdated scripts`
capitalize_redirects script ---------------------------- diff --git a/docs/scripts/index.rst b/docs/scripts/index.rst index 131fdb4..1f374ed 100644 --- a/docs/scripts/index.rst +++ b/docs/scripts/index.rst @@ -27,4 +27,5 @@ other unsorted maintenance - archive \ No newline at end of file + archive + outdated \ No newline at end of file diff --git a/docs/scripts/outdated.rst b/docs/scripts/outdated.rst new file mode 100644 index 0000000..5729578 --- /dev/null +++ b/docs/scripts/outdated.rst @@ -0,0 +1,185 @@ +Outdated scripts +================ + +This list contains outdated scripts from :term:`compat` banch which +haven't ported to the current :term:`core` branch of Pywikibot |version|. +Feel free to reactivate any script at any time by creating a Phabricator +task (:phab:`Porting request +<maniphest/task/edit/form/1/?projects=pywikibot,pywikibot-scripts,Pywikibot-compat-to-core&title=Port +Pywikibot%20compat%20script%20to%20core:%20>`) +or reactivate the specified task below. + +.. seealso:: :ref:`Archived scripts` + + +catimages script +---------------- + +**Image by content categorization** (:phab:`T66838)` + +Script to check uncategorized files. This script checks if a file +has some content that allows to assign it to a category. + + +censure script +-------------- + +**Bad word checker bot** (:phab:`T66839`) + +It checks new content for bad words and reports it on a log page. + +cfd script +---------- + +**This script processes the Categories for discussion working pag** + +It parses out the actions that need to be taken as a result of CFD +discussions (as posted to the working page by an administrator) and +performs them. + + +commons_category_redirect script +---------------------------------- + +**Script to clean up non-empty catecory redirect category on Commons** + +Moves all images, pages and categories in redirect categories to the +target category. + + +copyright script +---------------- + +**This robot checks copyright violation** (:phab:`T66848`) + +Checks for text violating copyright by looking for matches in search +engines. + + +copyright_clean script +----------------------- +**Script to remove on wiki pages reports of copyright.py** (:phab:`T66848`) + + +copyright_put script +--------------------- +**Script to put reports of copyright.py to wiki page** (:phab:`T66848`) + +deledpimage script +------------------ +**Script to remove EDP images in non-article namespaces** (:phab:`T66849`) + +Script hides images due to the Exemption Doctrine Policy in this way: + +* `[[Image:logo.jpg]]` --> `[[:Image:logo.jpg]]` +* `[[:Image:logo.jpg]]` pass +* `Image:logo.jpg` in gallery --> `[[:Image:logo.jpg]]` in gallery end +* `logo.jpg` (like used in template) --> hide(used `<!--logo.jpg-->`) + + +get script +---------- +**Get a page and writes its contents to standard output** + +This makes it possible to pipe the text to another process. + + +inline_images script +--------------------- +**Try to upload images which are linked inline** (:phab:`T66870`) + +This bot goes over multiple pages of the home wiki, and looks for +images that are linked inline (i.e., they are hosted from an +external server and hotlinked, instead of using the wiki's upload +function) and uploads it form url. + + +overcat_simple_filter script +------------------------------ + +**A bot to do some simple over categorization filtering** (:phab:`T66876`) + + +panoramiopicker script +---------------------- +**Script to copy a Panoramio set to image repository (Commons)** + + +spellcheck script +----------------- +**This bot spellchecks wiki pages.** (:phab:`T236642`) + +The script is checking whether a word, stripped to its 'essence' is in +a given list or not. It does not do any grammar checking or such. +For each unknown word, you get a couple of options:: + + numbered options: replace by known alternatives + a: This word is correct; add it to the list of known words + c: The uncapitalized form of this word is correct; add it + i: Do not edit this word, but do also not add it to the list + p: Do not edit this word, and consider it correct for this page only + r: Replace the word, and add the replacement as a known alternative + s: Replace the word, but do not add the replacement + *: Edit the page using the gui + g: Give a list of 'guessed' words, which are similar to the given one + x: Ignore this word, and do not check the rest of the page + +When the bot is ended, it will save the extensions to its word list; +there is one word list for each language. + +The bot does not rely on Latin script, but does rely on Latin punctuation. +It is therefore expected to work on for example Russian and Korean, but not +on for example Japanese. + + +splitwarning script +------------------- +**Splits a interwiki.log file into chunks of warnings separated by language** + + +standardize_notes script +------------------------- + +**This bot will standardize footnote references** + + +statistics_in_wikitable script +-------------------------------- + +**This bot renders siteinfo statistics in a table on a wiki page.** + +Thus it creates and updates a Statistics wikitable. + + +subster script +-------------- + +**Script which will does substitutions of tags within wiki page content** + +Robot which will does substitutions of tags within wiki page content with +external or other wiki text data. Like dynamic text updating. + + +tag_nowcommons script +---------------------- + +**This script tags files available at Commons with the Nowcommons template** +(:phab:`66159`) + + +us_states script +----------------- +**Check pages on the whether they are in common form** + +On English Wikipedia the common form is like `Something, State` +and if so, create a redirect from `Something, ST`. + + +warnfile script +--------------- + +**Script creates backlinks from a log file** + +A robot to implement backlinks from a interwiki.log file without checking +them against the live wikipedia. + diff --git a/docs/utilities/index.rst b/docs/utilities/scripts.rst similarity index 78% copy from docs/utilities/index.rst copy to docs/utilities/scripts.rst index df39e86..71b096f 100644 --- a/docs/utilities/index.rst +++ b/docs/utilities/scripts.rst @@ -1,29 +1,35 @@ -.. _utility_scripts: - Utility scripts ===============
+.. automodule:: pywikibot.scripts + :no-members: + pwb wrapper script ------------------
.. automodule:: pwb + :no-members:
generate_family_file script -----------------------------
.. automodule:: pywikibot.scripts.generate_family_file + :no-members:
generate_user_files script ----------------------------
.. automodule:: pywikibot.scripts.generate_user_files + :no-members:
shell script ------------
.. automodule:: pywikibot.scripts.shell + :no-members:
version script --------------
.. automodule:: pywikibot.scripts.version + :no-members: diff --git a/docs/utilities/index.rst b/docs/utilities/scripts_ref.rst similarity index 89% rename from docs/utilities/index.rst rename to docs/utilities/scripts_ref.rst index df39e86..253e8ca 100644 --- a/docs/utilities/index.rst +++ b/docs/utilities/scripts_ref.rst @@ -1,8 +1,9 @@ -.. _utility_scripts: - Utility scripts ===============
+.. automodule:: pywikibot.scripts + :private-members: + pwb wrapper script ------------------
diff --git a/pwb.py b/pwb.py index 15715fe..5fa8c9a 100755 --- a/pwb.py +++ b/pwb.py @@ -6,7 +6,7 @@
1. Scripts listed in `user_script_paths` list inside your `user-config.py` settings file in the given order. Refer - :ref:`External Script Path Settings<external-script-path-settings>`. + :ref:`External Script Path Settings`. 2. User scripts residing in `scripts/userscripts` (directory mode only). 3. Scripts residing in `scripts` folder (directory mode only). 4. Maintenance scripts residing in `scripts/maintenance` (directory mode only). diff --git a/pywikibot/page/_filepage.py b/pywikibot/page/_filepage.py index 5c43c89..6f074ce 100644 --- a/pywikibot/page/_filepage.py +++ b/pywikibot/page/_filepage.py @@ -182,6 +182,7 @@ :meth:`APISite.imageusage() <pywikibot.site._generators.GeneratorsMixin.imageusage>`
+ .. seealso:: :meth:`globalusage` .. versionchanged:: 7.2 all parameters from :meth:`APISite.imageusage() <pywikibot.site._generators.GeneratorsMixin.imageusage>` @@ -289,6 +290,8 @@ """ Iterate all global usage for this page.
+ .. seealso:: :meth:`usingPages` + :param total: iterate no more than this number of pages in total :return: a generator that yields Pages also on sites different from self.site. diff --git a/pywikibot/scripts/__init__.py b/pywikibot/scripts/__init__.py index 03090c6..fca31b6 100644 --- a/pywikibot/scripts/__init__.py +++ b/pywikibot/scripts/__init__.py @@ -8,7 +8,7 @@ from os import environ, getenv
-def _import_with_no_user_config(*import_args: str): +def _import_with_no_user_config(*import_args): """Return __import__(*import_args) without loading user-config.py.
.. versionadded:: 3.0 diff --git a/pywikibot/scripts/shell.py b/pywikibot/scripts/shell.py index 46cdb3f..075fbf1 100755 --- a/pywikibot/scripts/shell.py +++ b/pywikibot/scripts/shell.py @@ -2,17 +2,15 @@ """ Spawns an interactive Python shell and imports the pywikibot library.
-The following local option is supported: +The following local option is supported::
--noimport Do not import the pywikibot library. All other arguments are - ignored in this case. + -noimport Do not import the pywikibot library. All other arguments are + ignored in this case.
-Usage: +Usage::
python pwb.py shell [args]
-If no arguments are given, the pywikibot library will not be loaded. - .. versionchanged:: 7.0 moved to pywikibot.scripts """ diff --git a/scripts/archive/__init__.py b/scripts/archive/__init__.py index b87f80c..272826c 100644 --- a/scripts/archive/__init__.py +++ b/scripts/archive/__init__.py @@ -3,6 +3,7 @@ These scripts may be removed at any time without further warning.
Feel free to reactivate any script at any time by creating a Phabricator -task: -https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?projects=pywik... +task: :phab:`Recovery request +<maniphest/task/edit/form/1/?projects=pywikibot,pywikibot-scripts&title=Recover +Pywikibot%20script:%20>` """