jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/862284 )
Change subject: [doc] Update ROADMAP.rst and CHANGELOG.rst
......................................................................
[doc] Update ROADMAP.rst and CHANGELOG.rst
Change-Id: I6f54459dc57afb9bd994bcc40c758ed62852c159
---
M ROADMAP.rst
M scripts/CHANGELOG.rst
2 files changed, 23 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst
index d478166..7a3b1ae 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,6 +1,15 @@
Current release 8.0.0
---------------------
+* Let user the choice which section to be copied with :mod:`generate_user_files
+ <pywikibot.scripts.generate_user_files>` (:phab:`T145372`)
+* use :func:`roundrobin_generators<tools.itertools.roundrobin_generators>` to combine generators
+ when limit option is given
+* Ignore OSError if API cache cannot be written
+* Update tools._unidata._category_cf from Unicodedata version 15.0.0
+* :meth:`Timestamp.set_timestamp()<pywikibot.time.Timestamp.set_timestamp>` raises TypeError
+ instead of ValueError if conversion fails
+* Python 3.12 is supported
* All parameters of :meth:`Category.members()<page.Category.members>`,
:meth:`Category.subcategories()<page.Category.subcategories>` and
:meth:`Category.articles()<page.Category.articles>` are keyword only
diff --git a/scripts/CHANGELOG.rst b/scripts/CHANGELOG.rst
index 5ff4b7d..0119e56 100644
--- a/scripts/CHANGELOG.rst
+++ b/scripts/CHANGELOG.rst
@@ -14,6 +14,11 @@
* Enable pagegenerators options with ``move`` and ``remove`` actions (:phab:`T318239`)
+clean_sandbox
+~~~~~~~~~~~~~
+
+* A `-textfile` option was addet to fetch the text from a file
+
create_isbn_edition
~~~~~~~~~~~~~~~~~~~
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/862284
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I6f54459dc57afb9bd994bcc40c758ed62852c159
Gerrit-Change-Number: 862284
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/862225 )
Change subject: [doc] Fix docstring in maintenance/cache.py
......................................................................
[doc] Fix docstring in maintenance/cache.py
Change-Id: I2220879df7906b6c27eea792efe676337f970117
---
M scripts/maintenance/cache.py
1 file changed, 20 insertions(+), 15 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/maintenance/cache.py b/scripts/maintenance/cache.py
index 2340fab..9ae4129 100755
--- a/scripts/maintenance/cache.py
+++ b/scripts/maintenance/cache.py
@@ -74,6 +74,7 @@
import pickle
import sys
from pathlib import Path
+from typing import Optional
import pywikibot
from pywikibot.data import api
@@ -217,23 +218,18 @@
self._cachefile_path().unlink()
-def process_entries(cache_path, func, use_accesstime=None, output_func=None,
- action_func=None):
- """
- Check the contents of the cache.
+def process_entries(cache_path, func, use_accesstime: Optional[bool] = None,
+ output_func=None, action_func=None):
+ """Check the contents of the cache.
- This program tries to use file access times to determine
- whether cache files are being used.
- However file access times are not always usable.
- On many modern filesystems, they have been disabled.
- On Unix, check the filesystem mount options. You may
- need to remount with 'strictatime'.
+ This program tries to use file access times to determine whether
+ cache files are being used. However file access times are not always
+ usable. On many modern filesystems, they have been disabled. On Unix,
+ check the filesystem mount options. You may need to remount with
+ 'strictatime'.
- :param use_accesstime: Whether access times should be used.
- :type use_accesstime: bool tristate:
- - None = detect
- - False = don't use
- - True = always use
+ :param use_accesstime: Whether access times should be used. `None`
+ for detect, `False` for don't use and `True` for always use.
"""
if not cache_path:
cache_path = os.path.join(pywikibot.config.base_dir,
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/862225
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2220879df7906b6c27eea792efe676337f970117
Gerrit-Change-Number: 862225
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/861479 )
Change subject: [doc] fix documentation of generate_user_files
......................................................................
[doc] fix documentation of generate_user_files
Change-Id: I18b42ff0e951be2ea8f72bffa2a2e97edddf4cd2
Signed-off-by: Xqt <info(a)gno.de>
---
M pywikibot/scripts/generate_user_files.py
1 file changed, 11 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/scripts/generate_user_files.py b/pywikibot/scripts/generate_user_files.py
index ab2005c..6e532e3 100755
--- a/pywikibot/scripts/generate_user_files.py
+++ b/pywikibot/scripts/generate_user_files.py
@@ -5,7 +5,7 @@
moved to pywikibot.scripts folder.
.. versionchanged:: 8.0
let user the choice which section to be copied.
-...Also EXTERNAL EDITOR SETTINGS section can be copied.
+ Also EXTERNAL EDITOR SETTINGS section can be copied.
"""
#
# (C) Pywikibot team, 2010-2022
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/861479
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I18b42ff0e951be2ea8f72bffa2a2e97edddf4cd2
Gerrit-Change-Number: 861479
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860977 )
Change subject: [FEAT] Add a -textfile parameter to fetch the text from a file
......................................................................
[FEAT] Add a -textfile parameter to fetch the text from a file
Change-Id: I9fa2dd9ff61e9744398ca19f6ce4b41d37cdaab2
---
M scripts/clean_sandbox.py
1 file changed, 30 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/clean_sandbox.py b/scripts/clean_sandbox.py
index 5c63464..23b0060 100755
--- a/scripts/clean_sandbox.py
+++ b/scripts/clean_sandbox.py
@@ -18,7 +18,10 @@
The minimum delay time is 5 minutes.
-text The text that substitutes in the sandbox, you can use this
- when you haven't configured clean_candbox for your wiki.
+ when you haven't configured clean_sandbox for your wiki.
+
+ -textfile As an alternative to -text, you can use this to provide
+ a file containing the text to be used.
-summary Summary of the edit made by bot. Overrides the default
from i18n.
@@ -272,6 +275,7 @@
:param args: command line arguments
"""
opts = {}
+ textfile_opt = None
local_args = pywikibot.handle_args(args)
gen_factory = pagegenerators.GeneratorFactory()
for arg in local_args:
@@ -287,11 +291,27 @@
elif opt == 'text':
opts[opt] = value or pywikibot.input(
'What text do you want to substitute?')
+ elif opt == 'textfile':
+ textfile_opt = value or pywikibot.input(
+ 'What file contains the text you want to substitute with?')
elif opt == 'summary':
opts[opt] = value or pywikibot.input('Enter the summary:')
else:
gen_factory.handle_arg(arg)
+ if textfile_opt:
+ if 'text' in opts:
+ pywikibot.error(
+ 'Arguments -text and -textfile '
+ "can't be provided at the same time")
+ return
+ try:
+ with open(textfile_opt, 'r', encoding='utf-8') as textfile:
+ opts['text'] = textfile.read()
+ except OSError as e:
+ pywikibot.error(f'Error loading {opts["textfile"]}: {e}')
+ return
+
generator = gen_factory.getCombinedGenerator()
bot = SandboxBot(generator=generator, **opts)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860977
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I9fa2dd9ff61e9744398ca19f6ce4b41d37cdaab2
Gerrit-Change-Number: 860977
Gerrit-PatchSet: 7
Gerrit-Owner: Platonides <platonides(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki(a)aol.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860501 )
Change subject: Retrieve only one match
......................................................................
Retrieve only one match
Change-Id: I2e35bcc2e690d3fc0640dcf5e37928ef9d26087a
---
M scripts/checkimages.py
1 file changed, 12 insertions(+), 3 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/checkimages.py b/scripts/checkimages.py
index 5eb5923..ae6d170 100755
--- a/scripts/checkimages.py
+++ b/scripts/checkimages.py
@@ -610,10 +610,10 @@
def upload_bot_change_function(report_page_text, upload_bot_array) -> str:
"""Detect the user that has uploaded the file through upload bot."""
regex = upload_bot_array[1]
- results = re.findall(regex, report_page_text)
+ result = re.search(regex, report_page_text)
- if results:
- return results[0]
+ if result:
+ return result.group()
# we can't find the user, report the problem to the bot
return upload_bot_array[0]
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860501
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2e35bcc2e690d3fc0640dcf5e37928ef9d26087a
Gerrit-Change-Number: 860501
Gerrit-PatchSet: 2
Gerrit-Owner: Matěj Suchánek <matejsuchanek97(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860985 )
Change subject: [doc] Update documentation about protection
......................................................................
[doc] Update documentation about protection
Change-Id: Id92c696f68e83376db7f09b1346046d9596bbfa1
---
M pywikibot/site/_apisite.py
M pywikibot/page/_page.py
2 files changed, 106 insertions(+), 29 deletions(-)
Approvals:
Bináris: Looks good to me, but someone else must approve
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/page/_page.py b/pywikibot/page/_page.py
index bd2283a..1b424ed 100644
--- a/pywikibot/page/_page.py
+++ b/pywikibot/page/_page.py
@@ -31,7 +31,15 @@
import pywikibot
from pywikibot import Timestamp, config, date, i18n, textlib
-from pywikibot.backports import Generator, Iterable, Iterator, List, Set
+from pywikibot.backports import (
+ Dict,
+ Generator,
+ Iterable,
+ Iterator,
+ List,
+ Set,
+ Tuple,
+)
from pywikibot.cosmetic_changes import CANCEL, CosmeticChangesToolkit
from pywikibot.exceptions import (
Error,
@@ -1049,12 +1057,38 @@
content=content,
)
- def protection(self) -> dict:
- """Return a dictionary reflecting page protections."""
+ def protection(self) -> Dict[str, Tuple[str, str]]:
+ """Return a dictionary reflecting page protections.
+
+ **Example:**
+
+ >>> site = pywikibot.Site('wikipedia:test')
+ >>> page = pywikibot.Page(site, 'Main Page')
+ >>> page.protection()
+ {'edit': ('sysop', 'infinity'), 'move': ('sysop', 'infinity')}
+
+ .. seealso::
+ - :meth:`Site.page_restrictions()
+ <pywikibot.site._apisite.APISite.page_restrictions>`
+ - :meth:`applicable_protections`
+ - :meth:`protect`
+ """
return self.site.page_restrictions(self)
def applicable_protections(self) -> Set[str]:
- """Return the protection types allowed for that page."""
+ """Return the protection types allowed for that page.
+
+ **Example:**
+
+ >>> site = pywikibot.Site('wikipedia:test')
+ >>> page = pywikibot.Page(site, 'Main Page')
+ >>> sorted(page.applicable_protections())
+ ['edit', 'move']
+
+ .. seealso::
+ - :meth:`protect`
+ - :meth:`protection`
+ """
self.site.loadpageinfo(self)
return self._applicable_protections
@@ -2008,27 +2042,35 @@
def protect(self,
reason: Optional[str] = None,
- protections: Optional[dict] = None,
+ protections: Optional[Dict[str, Optional[str]]] = None,
**kwargs) -> None:
- """
- Protect or unprotect a wiki page. Requires administrator status.
+ """Protect or unprotect a wiki page. Requires *protect* right.
- Valid protection levels are '' (equivalent to 'none'),
- 'autoconfirmed', 'sysop' and 'all'. 'all' means 'everyone is allowed',
- i.e. that protection type will be unprotected.
+ Valid protection levels are ``''`` (equivalent to ``None``),
+ ``'autoconfirmed'``, ``'sysop'`` and ``'all'``. ``'all'`` means
+ everyone is allowed, i.e. that protection type will be
+ unprotected.
- In order to unprotect a type of permission, the protection level shall
- be either set to 'all' or '' or skipped in the protections dictionary.
+ In order to unprotect a type of permission, the protection level
+ shall be either set to ``'all'`` or ``''`` or skipped in the
+ protections dictionary.
- Expiry of protections can be set via kwargs, see Site.protect() for
+ Expiry of protections can be set via *kwargs*, see
+ :meth:`Site.protect()<pywikibot.site._apisite.APISite.protect>` for
details. By default there is no expiry for the protection types.
- :param protections: A dict mapping type of protection to protection
- level of that type. Allowed protection types for a page can be
- retrieved by Page.self.applicable_protections()
+ .. seealso::
+ - :meth:`Site.protect()
+ <pywikibot.site._apisite.APISite.protect>`
+ - :meth:`applicable_protections`
+
+ :param protections: A dict mapping type of protection to
+ protection level of that type. Allowed protection types for
+ a page can be retrieved by :meth:`applicable_protections`.
Defaults to protections is None, which means unprotect all
protection types.
- Example: {'move': 'sysop', 'edit': 'autoconfirmed'}
+
+ Example: ``{'move': 'sysop', 'edit': 'autoconfirmed'}``
:param reason: Reason for the action, default is None and will set an
empty string.
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index c892912..da2b051 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -55,7 +55,7 @@
)
from pywikibot.login import LoginStatus as _LoginStatus
from pywikibot.site._basesite import BaseSite
-from pywikibot.site._decorators import need_right
+from pywikibot.site._decorators import need_right, need_version
from pywikibot.site._extensions import (
EchoMixin,
FlowMixin,
@@ -1393,7 +1393,17 @@
self,
page: 'pywikibot.page.BasePage'
) -> Dict[str, Tuple[str, str]]:
- """Return a dictionary reflecting page protections."""
+ """Return a dictionary reflecting page protections.
+
+ **Example:**
+
+ >>> site = pywikibot.Site('wikipedia:test')
+ >>> page = pywikibot.Page(site, 'Main Page')
+ >>> site.page_restrictions(page)
+ {'edit': ('sysop', 'infinity'), 'move': ('sysop', 'infinity')}
+
+ .. seealso:: :meth:`page.BasePage.protection` (should be preferred)
+ """
if not hasattr(page, '_protection'):
self.loadpageinfo(page)
return page._protection
@@ -2523,21 +2533,33 @@
"""
Return the protection types available on this site.
+ **Example:**
+
+ >>> site = pywikibot.Site('wikipedia:test')
+ >>> sorted(site.protection_types())
+ ['create', 'edit', 'move', 'upload']
+
.. seealso:: :py:obj:`Siteinfo._get_default()`
:return: protection types available
"""
return set(self.siteinfo.get('restrictions')['types'])
+ @need_version('1.27.3')
def protection_levels(self) -> Set[str]:
"""
Return the protection levels available on this site.
+ **Example:**
+
+ >>> site = pywikibot.Site('wikipedia:test')
+ >>> sorted(site.protection_levels())
+ ['', 'autoconfirmed', ... 'sysop', 'templateeditor']
+
.. seealso:: :py:obj:`Siteinfo._get_default()`
:return: protection types available
"""
- # implemented in b73b5883d486db0e9278ef16733551f28d9e096d
return set(self.siteinfo.get('restrictions')['levels'])
@need_right('protect')
@@ -2549,19 +2571,23 @@
expiry: Union[datetime.datetime, str, None] = None,
**kwargs: Any
) -> None:
- """(Un)protect a wiki page. Requires administrator status.
+ """(Un)protect a wiki page. Requires *protect* right.
- .. seealso:: :api:`Protect`
+ .. seealso::
+ - :api:`Protect`
+ - :meth:`protection_types`
+ - :meth:`protection_levels`
- :param protections: A dict mapping type of protection to protection
- level of that type. Valid restriction types are 'edit', 'create',
- 'move' and 'upload'. Valid restriction levels are '' (equivalent
- to 'none' or 'all'), 'autoconfirmed', and 'sysop'.
- If None is given, however, that protection will be skipped.
+ :param protections: A dict mapping type of protection to
+ protection level of that type. Refer :meth:`protection_types`
+ for valid restriction types and :meth:`protection_levels`
+ for valid restriction levels. If None is given, however,
+ that protection will be skipped.
:param reason: Reason for the action
:param expiry: When the block should expire. This expiry will be
- applied to all protections. If None, 'infinite', 'indefinite',
- 'never', or '' is given, there is no expiry.
+ applied to all protections. If ``None``, ``'infinite'``,
+ ``'indefinite'``, ``'never'``, or ``''`` is given, there is
+ no expiry.
"""
token = self.tokens['csrf']
self.lock_page(page)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860985
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Id92c696f68e83376db7f09b1346046d9596bbfa1
Gerrit-Change-Number: 860985
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Bináris <wikiposta(a)gmail.com>
Gerrit-Reviewer: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860982 )
Change subject: [docs] Improve basic content structure and navigation
......................................................................
[docs] Improve basic content structure and navigation
* add code block language indicators
* unify section and page naming, add sections where appropriate,
align heading syntax with Python style guide
* remove horizontal line on framework.png
* improve style in some sections
* rename installation to introduction
(keep old page as redirect)
* remove unnecessary indentation
* remove duplicated navigation entries
* fix README tables
Patch detached from tests branch because file outside docs folder
are affected.
Bug: T323812
Change-Id: I810d27449a43aba1e361bab64aab3a42618efe30
---
M docs/getting_help.rst
M ROADMAP.rst
M README.rst
M docs/recipes.rst
M scripts/README.rst
M docs/index.rst
M docs/scripts_ref/scripts.maintenance.rst
M docs/api_ref/index.rst
M docs/global_options.rst
M docs/library_usage.rst
M docs/utilities/scripts_ref.rst
M HISTORY.rst
M docs/scripts_ref/index.rst
M docs/scripts_ref/scripts.i18n.rst
M docs/scripts_ref/scripts.rst
M CODE_OF_CONDUCT.rst
M docs/mwapi.rst
M docs/utilities/scripts.rst
M docs/tests_ref/index.rst
M docs/changelog.rst
M docs/installation.rst
M docs/scripts/index.rst
M docs/framework.png
A docs/introduction.rst
M docs/utilities/install.rst
M docs/faq.rst
M docs/scripts_ref/scripts.userscripts.rst
27 files changed, 391 insertions(+), 351 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst
index cb0641f..71156e2 100644
--- a/CODE_OF_CONDUCT.rst
+++ b/CODE_OF_CONDUCT.rst
@@ -1,5 +1,5 @@
Code of Conduct
----------------
+===============
The development of this software is covered by a
`Code of Conduct <https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct>`_.
diff --git a/HISTORY.rst b/HISTORY.rst
index de1ace6..f1eeda2 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,5 +1,5 @@
Release history
-^^^^^^^^^^^^^^^
+===============
7.7.1
-----
@@ -197,7 +197,7 @@
*26 February 2022*
Improvements
-~~~~~~~~~~~~
+^^^^^^^^^^^^
* i18n updates for date.py
* Add number transliteration of 'lo', 'ml', 'pa', 'te' to NON_LATIN_DIGITS
@@ -240,7 +240,7 @@
* New "maxlimit" property was added to APISite (:phab:`T291770`)
Bugfixes
-~~~~~~~~
+^^^^^^^^
* Don't raise an exception if BlockEntry initializer found a hidden title (:phab:`T78152`)
* Fix KeyError in create_warnings_list (:phab:`T301610`)
@@ -261,14 +261,14 @@
* Raise a generic ServerError if the http status code is unofficial (:phab:`T293208`)
Breaking changes
-~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^
* Support of Python 3.5.0 - 3.5.2 has been dropped (:phab:`T286867`)
* generate_user_files.py, generate_user_files.py, shell.py and version.py were moved to pywikibot/scripts and must be used with pwb wrapper script
* *See also Code cleanups below*
Code cleanups
-~~~~~~~~~~~~~
+^^^^^^^^^^^^^
* Deprecated http.get_fake_user_agent() function was removed
* FilePage.fileIsShared() was removed in favour of FilePage.file_is_shared()
@@ -436,7 +436,7 @@
*28 May 2021*
Improvements and Bugfixes
-~~~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^^^
* Use different logfiles for multiple processes of the same script (:phab:`T56685`)
* throttle.pip will be reused as soon as possbile
@@ -452,7 +452,7 @@
* Handle abusefilter-{disallow,warning} codes (:phab:`T85656`)
Code cleanups
-~~~~~~~~~~~~~
+^^^^^^^^^^^^^
* MultipleSitesBot.site attribute was removed (:phab:`T283209`)
* Deprecated BaseSite.category_namespaces() method was removed
@@ -481,7 +481,7 @@
*17 April 2021*
Improvements and Bugfixes
-~~~~~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^^^^^
* interwiki_graph module was restored (:phab:`T223826`)
* proofreadpage: search for "new" class after purge (:phab:`T280357`)
@@ -496,7 +496,7 @@
* Family files can be collected from a zip folder (:phab:`T278076`)
Dependencies
-~~~~~~~~~~~~
+^^^^^^^^^^^^
* **mwparserfromhell** or **wikitextparser** are strictly recommended (:phab:`T106763`)
* Require **Pillow**>=8.1.1 due to vulnerability found (:phab:`T278743`)
@@ -505,7 +505,7 @@
* Add support for **PyMySQL** 1.0.0+
Code cleanups
-~~~~~~~~~~~~~
+^^^^^^^^^^^^^
* APISite.resolvemagicwords(), BaseSite.ns_index() and remove BaseSite.getNamespaceIndex() were removed
* Deprecated MoveEntry.new_ns() and new_title() methods were removed
@@ -528,7 +528,7 @@
*16 March 2021*
Breaking changes
-~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^
* interwiki_graph module was removed (:phab:`T223826`)
* Require setuptools >= 20.2 due to :pep:`440`
@@ -538,7 +538,7 @@
* config.db_hostname has been renamed to db_hostname_format
Code cleanups
-~~~~~~~~~~~~~
+^^^^^^^^^^^^^
* tools.PY2 was removed (:phab:`T213287`)
* Site.language() method was removed in favour of Site.lang property
@@ -555,7 +555,7 @@
* Unused comms.threadedhttp module was removed; threadedhttp.HttpRequest was already replaced with requests.Response (:phab:`T265206`)
Other changes
-~~~~~~~~~~~~~
+^^^^^^^^^^^^^
* Raise a SiteDefinitionError if api request response is Non-JSON and site is AutoFamily (:phab:`T272911`)
* Support deleting and undeleting specific file versions (:phab:`T276725`)
@@ -1331,7 +1331,7 @@
* CODE_OF_CONDUCT included
Bugfixes
-~~~~~~~~
+^^^^^^^^
* Manage temporary readonly error (:phab:`T154011`)
* Unbreak wbGeoShape and WbTabularData (:phab:`T166362`)
* Clean up issue with _WbDataPage (:phab:`T166362`)
@@ -1343,7 +1343,7 @@
* Fix TestLazyLoginNotExistUsername test for Stewardwiki (:phab:`T169458`)
Improvements
-~~~~~~~~~~~~
+^^^^^^^^^^^^
* Introduce the new WbUnknown data type for Wikibase (:phab:`T165961`)
* djvu.py: add replace_page() and delete_page()
* Build GeoShape and TabularData from shared base class
@@ -1367,7 +1367,7 @@
* Make WbRepresentations hashable (:phab:`T167827`)
Updates
-~~~~~~~
+^^^^^^^
* Update linktails
* Update languages_by_size
* Update cross_allowed (global bot wikis group)
@@ -1389,7 +1389,7 @@
* Localisation updates
Bugfixes
-~~~~~~~~
+^^^^^^^^
* Increase the default socket_timeout to 75 seconds (:phab:`T163635`)
* use repr() of exceptions to prevent UnicodeDecodeErrors (:phab:`T120222`)
* Handle offset mismatches during chunked upload (:phab:`T156402`)
@@ -1402,7 +1402,7 @@
* Remove wikidataquery from pywikibot (:phab:`T162585`)
Improvements
-~~~~~~~~~~~~
+^^^^^^^^^^^^
* Introduce user_add_claim and allow asynchronous ItemPage.addClaim (:phab:`T87493`)
* Enable private edit summary in specialbots (:phab:`T162527`)
* Make a decorator for asynchronous methods
@@ -1429,7 +1429,7 @@
* Get thumburl information in FilePage() (:phab:`T137011`)
Updates
-~~~~~~~
+^^^^^^^
* Update languages_by_size in family files
* wikisource_family.py: Add "pa" to languages_by_size
* Config2: limit the number of retries to 15 (:phab:`T165898`)
@@ -1444,7 +1444,7 @@
* Deprecate previous 2.0 branches and tags
Bugfixes
-~~~~~~~~
+^^^^^^^^
* Use default summary when summary value does not contain a string (:phab:`T160823`)
* Enable specialbots.py for PY3 (:phab:`T161457`)
* Change tw(n)translate from Site.code to Site.lang dependency (:phab:`T140624`)
@@ -1466,7 +1466,7 @@
* Fix broken LDAP based login (:phab:`T90149`)
Improvements
-~~~~~~~~~~~~
+^^^^^^^^^^^^
* Simplify User class
* Renamed isImage and isCategory
* Add -property option to pagegenerators.py
@@ -1485,7 +1485,7 @@
* Fix and improve default regexes
Updates
-~~~~~~~
+^^^^^^^
* Update linktrails
* Update languages_by_size
* Updating global bot wikis, closed wikis and deleted wikis
@@ -1507,7 +1507,7 @@
* Last stable 2.0 branch
Bugfixes
-~~~~~~~~
+^^^^^^^^
* Establish the project's name, once and for all
* setup.py: Add Python 3.4 and 3.5 to pypi classifiers
* Remove item count output in page generators
@@ -1543,7 +1543,7 @@
*15 December 2015*
Bugfixes
-~~~~~~~~
+^^^^^^^^
* Remove dependency on pYsearch
* Require google>=0.7
* Desupport Python 2.6 for Pywikibot 2.0 release branch
@@ -1577,7 +1577,7 @@
*30 September 2015*
Bugfixes
-~~~~~~~~
+^^^^^^^^
* New Wikipedia site: azb
* Indexes in str.format
* MediaWikiVersion: Accept new wmf style
@@ -1593,18 +1593,18 @@
*9 July 2015*
Configuration updates
-~~~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^^^
* Changing the sandbox content template on Fa WP
Family file updates
-~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^
* Remove broken wikis from battlestarwiki family
* Adding euskara and sicilianu languages to Vikidia family
* WOW Wiki subdomains hr, ro & sr deleted
* Add new Wikipedia languages gom and lrc
Bugfixes
-~~~~~~~~
+^^^^^^^^
* fix UnicodeDecodeError on api error
* pwb.py now correctly passes arguments to generate_family_file
* Fix Win32 config.editor detection
diff --git a/README.rst b/README.rst
index 007e564..876bb38 100644
--- a/README.rst
+++ b/README.rst
@@ -35,9 +35,9 @@
:alt: Last commit
:target: https://gerrit.wikimedia.org/r/plugins/gitiles/pywikibot/core/
-
+*********
Pywikibot
-=========
+*********
The Pywikibot framework is a Python library that interfaces with the
`MediaWiki API <https://www.mediawiki.org/wiki/API:Main_page>`_
@@ -50,9 +50,9 @@
the full `code documentation <https://doc.wikimedia.org/pywikibot/>`_.
Quick start
------------
+===========
-::
+.. code:: text
pip install requests
git clone https://gerrit.wikimedia.org/r/pywikibot/core.git
@@ -62,7 +62,7 @@
Or to install using PyPI (excluding scripts)
-::
+.. code:: text
pip install -U setuptools
pip install pywikibot
@@ -70,13 +70,13 @@
In addition a MediaWiki markup parser is required. Please install one of them:
-::
+.. code:: text
pip install mwparserfromhell
or
-::
+.. code:: text
pip install wikitextparser
@@ -85,11 +85,11 @@
has more details for advanced usage.
Basic Usage
------------
+===========
If you wish to write your own script it's very easy to get started:
-::
+.. code:: python
import pywikibot
site = pywikibot.Site('en', 'wikipedia') # The site we want to run our bot on
@@ -98,12 +98,12 @@
page.save('Replacing "foo" with "bar"') # Saves the page
Wikibase Usage
---------------
+==============
Wikibase is a flexible knowledge base software that drives Wikidata.
A sample pywikibot script for getting data from Wikibase:
-::
+.. code:: python
import pywikibot
site = pywikibot.Site('wikipedia:en')
@@ -113,11 +113,11 @@
data = item.get() # get all item data from repository for this item
Script example
---------------
+==============
Pywikibot provides bot classes to develop your own script easily:
-::
+.. code:: python
import pywikibot
from pywikibot import pagegenerators
@@ -157,17 +157,17 @@
Roadmap
--------
+=======
.. include:: ROADMAP.rst
Release history
----------------
+===============
See https://github.com/wikimedia/pywikibot/blob/stable/HISTORY.rst
Contributing
-------------
+============
Our code is maintained on Wikimedia's `Gerrit installation <https://gerrit.wikimedia.org/>`_,
`learn <https://www.mediawiki.org/wiki/Developer_account>`_ how to get
diff --git a/ROADMAP.rst b/ROADMAP.rst
index 41032d0..d478166 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -1,5 +1,5 @@
Current release 8.0.0
-^^^^^^^^^^^^^^^^^^^^^
+---------------------
* All parameters of :meth:`Category.members()<page.Category.members>`,
:meth:`Category.subcategories()<page.Category.subcategories>` and
@@ -29,7 +29,7 @@
* MediaWiki API cross reference was added to the documentation
Deprecations
-^^^^^^^^^^^^
+------------
* 8.0.0: :meth:`APISite.messages()<pywikibot.site._apisite.APISite.messages>` method is deprecated in favour of
:attr:`userinfo['messages']<pywikibot.site._apisite.APISite.userinfo>`
@@ -67,6 +67,6 @@
Will be removed in Pywikibot 8
-------------------------------
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
* 5.5.0: APISite.redirectRegex() will be removed in favour of APISite.redirect_regex()
diff --git a/docs/api_ref/index.rst b/docs/api_ref/index.rst
index c6bb0df..bb402e6 100644
--- a/docs/api_ref/index.rst
+++ b/docs/api_ref/index.rst
@@ -13,7 +13,7 @@
functions provided by :mod:`data.api`. This layer then uses :func:`comms.http.request`
to do the actual HTTP request.
-Table of Contents
+Table of contents
=================
.. toctree::
diff --git a/docs/changelog.rst b/docs/changelog.rst
index 8e6a551..b12b4ac 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -1,10 +1,12 @@
-:tocdepth: 3
-
+**********
Change log
-==========
+**********
What is new with Pywikibot |release|? What are the main changes of older version?
+Roadmap
+=======
+
.. include:: ../ROADMAP.rst
.. include:: ../HISTORY.rst
diff --git a/docs/faq.rst b/docs/faq.rst
index f0530b7..f707136 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -1,5 +1,6 @@
-Frequent Asked Questions
+Frequent asked questions
========================
+
**How to speed up Pywikibot?**
1. The first time you are using Pywikibot for multiple Wikimedia sites you
can run :py:mod:`preload_sites <pywikibot.scripts.preload_sites>` script
@@ -35,4 +36,3 @@
**pywikibot.i18n.TranslationError: No English translation has been defined**
It can happen due to lack of i18n submodule or files. Update i18n submodule
or download these files first. See also: :manpage:`i18n` manual.
-
diff --git a/docs/framework.png b/docs/framework.png
index ec4cbc2..1956ec8 100644
--- a/docs/framework.png
+++ b/docs/framework.png
Binary files differ
diff --git a/docs/getting_help.rst b/docs/getting_help.rst
index 208af04..52c3f16 100644
--- a/docs/getting_help.rst
+++ b/docs/getting_help.rst
@@ -2,8 +2,8 @@
------------
.. note::
- Please see :manpage:`Communication`.
+ For information on how to connect with Pywikibot developers and users, see :manpage:`Communication`.
.. tip::
- Please report bugs at `Phabricator <https://phabricator.wikimedia.org/>`_.
- You may use `this report form <https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?tags=pywikibo…>`_.
+ Please report bugs in `Phabricator <https://phabricator.wikimedia.org/>`_.
+ You can use `this report form <https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?tags=pywikibo…>`_.
diff --git a/docs/global_options.rst b/docs/global_options.rst
index 57af62a..59f082d 100644
--- a/docs/global_options.rst
+++ b/docs/global_options.rst
@@ -1,4 +1,4 @@
-Global Options
+Global options
--------------
Global arguments available for all bots:
@@ -6,4 +6,4 @@
.. literalinclude:: ../pywikibot/bot.py
:language: console
:start-after: (Global arguments available for all bots)
- :end-before: """
\ No newline at end of file
+ :end-before: """
diff --git a/docs/index.rst b/docs/index.rst
index 4384161..4dd75b9 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -36,13 +36,14 @@
:alt: Framework modules dependency network
-For bot users:
---------------
+Contents
+--------
.. toctree::
:maxdepth: 1
+ :caption: User guide
- installation
+ introduction
utilities/scripts
scripts/index
global_options
@@ -50,34 +51,27 @@
getting_help
-For bot developers:
--------------------
-
.. toctree::
:maxdepth: 1
+ :caption: Bot developer guide
library_usage
recipes
api_ref/index
mwapi
-For framework developers:
--------------------------
-
.. toctree::
:maxdepth: 1
+ :caption: Pywikibot contributor guide
- Utility Scripts Reference<utilities/scripts_ref>
+ utilities/scripts_ref
scripts_ref/index
- tests_ref/index
- Maintenance Scripts<scripts_ref/scripts.maintenance>
utilities/install
+ tests_ref/index
-
-Miscellaneous
--------------
.. toctree::
:maxdepth: 1
+ :caption: About
glossary
changelog
@@ -86,4 +80,4 @@
.. _CC-BY-SA 3.0: https://creativecommons.org/licenses/by-sa/3.0/
-.. _Pywikibot Manual: https://www.mediawiki.org/wiki/Manual:Pywikibot
\ No newline at end of file
+.. _Pywikibot Manual: https://www.mediawiki.org/wiki/Manual:Pywikibot
diff --git a/docs/installation.rst b/docs/installation.rst
index cc555a4..b39bd99 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -1,43 +1,6 @@
+:orphan:
+
Installation
============
-.. include:: ../README.rst
- :end-before: For more documentation on Pywikibot
-
-Settings
---------
-
-It is recommended to create a `user-config.py` file if Pywikibot is used as a
-site package. If Pywikibot is used in directory mode e.g. from a repository
-the configuration file is mandatory. A minimal sample is shown below.
-
-.. literalinclude:: ../user-config.py.sample
-
-This sample is shipped with the repository but is not available with
-the site-package. For more settings use
-:mod:`generate_user_files<pywikibot.scripts.generate_user_files>` script
-or refer :py:mod:`pywikibot.config` module.
-
-.. seealso:: :manpage:`Installation` Manual
-
-
-Internationalisation (i18n)
----------------------------
-
-Some of the framework input interaction is translated. The user interface
-language to be used can be set as follows:
-
-#. set the `userinterface_lang` in your :ref:`user-config.py<User Interface Settings>` to your preferred language
-#. set environment variable `PYWIKIBOT_USERINTERFACE_LANG` to your preferred language
-#. default is obtained from `locale.getdefaultlocale`
-#. fallback is `'en'` for english if all other options fails
-
-.. note:: The preferred language code must follow ISO 639.
-.. versionadded:: 7.0
- Added to site-package distribution
-.. seealso::
- * :manpage:`i18n` Manual
- * `MediaWiki Language Codes <https://www.mediawiki.org/wiki/Manual:Language#Language_code>`_
- * :ref:`User Interface Settings`
- * :py:mod:`pywikibot.i18n`
-
+Moved to :doc:`introduction`.
diff --git a/docs/introduction.rst b/docs/introduction.rst
new file mode 100644
index 0000000..922fd22
--- /dev/null
+++ b/docs/introduction.rst
@@ -0,0 +1,44 @@
+************
+Introduction
+************
+
+.. include:: ../README.rst
+ :end-before: For more documentation on Pywikibot
+ :start-line: 41
+
+Settings
+========
+
+It is recommended to create a `user-config.py` file if Pywikibot is used as a
+site package. If Pywikibot is used in directory mode e.g. from a repository
+the configuration file is mandatory. A minimal sample is shown below.
+
+.. literalinclude:: ../user-config.py.sample
+
+This sample is shipped with the repository but is not available with
+the site-package. For more settings use
+:mod:`generate_user_files<pywikibot.scripts.generate_user_files>` script
+or refer :py:mod:`pywikibot.config` module.
+
+.. seealso:: :manpage:`Installation` Manual
+
+
+Internationalisation (i18n)
+===========================
+
+Some of the framework input interaction is translated. The user interface
+language to be used can be set as follows:
+
+#. set the `userinterface_lang` in your :ref:`user-config.py<User Interface Settings>` to your preferred language
+#. set environment variable `PYWIKIBOT_USERINTERFACE_LANG` to your preferred language
+#. default is obtained from `locale.getdefaultlocale`
+#. fallback is `'en'` for English if all other options fails
+
+.. note:: The preferred language code must follow ISO 639.
+.. versionadded:: 7.0
+ Added to site-package distribution
+.. seealso::
+ * :manpage:`i18n` Manual
+ * `MediaWiki Language Codes <https://www.mediawiki.org/wiki/Manual:Language#Language_code>`_
+ * :ref:`User Interface Settings`
+ * :py:mod:`pywikibot.i18n`
diff --git a/docs/library_usage.rst b/docs/library_usage.rst
index c75d413..6afb89e 100644
--- a/docs/library_usage.rst
+++ b/docs/library_usage.rst
@@ -1,8 +1,13 @@
+**************************
Using pywikibot as library
---------------------------
+**************************
-Pywikibot provides bot classes to develop your own script easily. Here
-is a minimal example script which shows their usage:
+Pywikibot provides bot classes to develop your own script easily.
+
+Minimal example
+===============
+
+Here is a minimal example script which shows their usage:
.. code-block:: python
:linenos:
@@ -45,7 +50,8 @@
python mybot -site:wikipedia:test -page:Sandbox -text:"A text added to the sandbox"
-**Explanations:**
+Explanation
+-----------
:1-3: Import necessary framework code parts:
:mod:`pywikibot`, :mod:`pywikibot.pagegenerators`,
@@ -89,7 +95,7 @@
:29: Create the bot passing keyword only parameters and run it.
Basic script
-~~~~~~~~~~~~
+============
:py:obj:`scripts.basic` is a more advanced sample script and shipped
with the scripts folder. Here is the content:
@@ -98,4 +104,4 @@
:language: python
.. note::
- Please also see the documentation at :manpage:`Create your own script`
+ Also see the documentation at :manpage:`Create your own script`
diff --git a/docs/mwapi.rst b/docs/mwapi.rst
index 321aaaa..fed2829 100644
--- a/docs/mwapi.rst
+++ b/docs/mwapi.rst
@@ -3,9 +3,11 @@
<br />
-MediaWiki API Cross Reference
+MediaWiki API cross reference
=============================
+See the table below for a cross reference between MediaWiki's API and Pywikibot's API.
+
.. list-table::
:header-rows: 1
:align: left
diff --git a/docs/recipes.rst b/docs/recipes.rst
index 5e335ed..c0c3983 100644
--- a/docs/recipes.rst
+++ b/docs/recipes.rst
@@ -1,24 +1,25 @@
Recipes
=======
-Page content
-------------
+How to modify a page
+--------------------
-**How to modify a page**
- >>> page = pywikibot.Page(pywikibot.Site(), 'Sample page')
- >>> new_content = page.text.replace('this', 'that')
- >>> page.put(new_content, summary='Bot: Test edit')
+>>> page = pywikibot.Page(pywikibot.Site(), 'Sample page')
+>>> new_content = page.text.replace('this', 'that')
+>>> page.put(new_content, summary='Bot: Test edit')
- See :doc:`library_usage` for more advanced samples.
+See :doc:`library_usage` for more advanced samples.
-**How to get links from summary section of page**
- >>> import pywikibot
- >>> from pwikibot import textlib
- >>> site = pywikibot.Site('wikipedia:en') # create a Site object
- >>> page = pywikibot.Page(site, 'Deep learning') # create a Page object
- >>> sect = textlib.extract_sections(page.text, site) # divide content into sections
- >>> links = sorted(link['title'] for link in pywikibot.link_regex.finditer(sect.header))
- >>> pages = [pywikibot.Page(site, title) for title in links]
+How to get links from summary section of page
+---------------------------------------------
- ``links`` is a list containing all link titles in alphabethical order.
- ``pages`` is a sorted list containing all ``Page`` objects
\ No newline at end of file
+>>> import pywikibot
+>>> from pwikibot import textlib
+>>> site = pywikibot.Site('wikipedia:en') # create a Site object
+>>> page = pywikibot.Page(site, 'Deep learning') # create a Page object
+>>> sect = textlib.extract_sections(page.text, site) # divide content into sections
+>>> links = sorted(link['title'] for link in pywikibot.link_regex.finditer(sect.header))
+>>> pages = [pywikibot.Page(site, title) for title in links]
+
+* ``links`` is a list containing all link titles in alphabethical order
+* ``pages`` is a sorted list containing all ``Page`` objects
diff --git a/docs/scripts/index.rst b/docs/scripts/index.rst
index 95d07b9..dec2fe6 100644
--- a/docs/scripts/index.rst
+++ b/docs/scripts/index.rst
@@ -1,5 +1,6 @@
-Scripts Package Description
----------------------------
+===============
+Scripts package
+===============
.. automodule:: scripts
:no-members:
@@ -9,8 +10,8 @@
:start-after: included.
:end-before: More precise
-Scripts Descriptions
---------------------
+Script descriptions
+===================
.. toctree::
:maxdepth: 1
@@ -29,4 +30,4 @@
unsorted
maintenance
archive
- outdated
\ No newline at end of file
+ outdated
diff --git a/docs/scripts_ref/index.rst b/docs/scripts_ref/index.rst
index 0e32244..04b5165 100644
--- a/docs/scripts_ref/index.rst
+++ b/docs/scripts_ref/index.rst
@@ -1,9 +1,6 @@
-Scripts Reference
+Scripts reference
-----------------
-Provided scripts by Pywikibot
-=============================
-
Pywikibot framework has a lot of ready-to-use scripts for several tasks.
In general the usage and options of all scripts may be shown by using the command
``<scriptname> -help``
@@ -15,4 +12,7 @@
.. toctree::
:glob:
- *
+ scripts
+ scripts.i18n
+ scripts.maintenance
+ scripts.userscripts
diff --git a/docs/scripts_ref/scripts.i18n.rst b/docs/scripts_ref/scripts.i18n.rst
index 20aa2a0..a47108e 100644
--- a/docs/scripts_ref/scripts.i18n.rst
+++ b/docs/scripts_ref/scripts.i18n.rst
@@ -1,4 +1,4 @@
-scripts.i18n translation files
-==============================
+Translation files - scripts.i18n
+================================
-.. automodule:: scripts.i18n
\ No newline at end of file
+.. automodule:: scripts.i18n
diff --git a/docs/scripts_ref/scripts.maintenance.rst b/docs/scripts_ref/scripts.maintenance.rst
index 112695e..4f8df36 100644
--- a/docs/scripts_ref/scripts.maintenance.rst
+++ b/docs/scripts_ref/scripts.maintenance.rst
@@ -1,34 +1,35 @@
-scripts.maintenance utility scripts
-===================================
+Maintenance scripts
+===================
+
+This page contains documentation of the `scripts.maintenance` module:
.. automodule:: scripts.maintenance
-Maintenance Submodules
+Maintenance submodules
----------------------
-scripts.maintenance.cache script
+scripts.maintenance.cache
--------------------------------
.. automodule:: scripts.maintenance.cache
:ignore-module-all:
-scripts.maintenance.colors script
+scripts.maintenance.colors
---------------------------------
.. automodule:: scripts.maintenance.colors
-scripts.maintenance.make\_i18n\_dict script
+scripts.maintenance.make\_i18n\_dict
-------------------------------------------
.. automodule:: scripts.maintenance.make_i18n_dict
-scripts.maintenance.sorting\_order script
+scripts.maintenance.sorting\_order
-----------------------------------------
.. automodule:: scripts.maintenance.sorting_order
-scripts.maintenance.wikimedia\_sites script
+scripts.maintenance.wikimedia\_sites
-------------------------------------------
.. automodule:: scripts.maintenance.wikimedia_sites
-
diff --git a/docs/scripts_ref/scripts.rst b/docs/scripts_ref/scripts.rst
index 2254477..da12f0a 100644
--- a/docs/scripts_ref/scripts.rst
+++ b/docs/scripts_ref/scripts.rst
@@ -1,17 +1,8 @@
-scripts package
+Scripts package
===============
.. automodule:: scripts
-Scripts Subpackages
--------------------
-
-.. toctree::
-
- scripts.i18n
- scripts.maintenance
- scripts.userscripts
-
add\_text script
----------------
@@ -281,4 +272,11 @@
.. automodule:: scripts.welcome
+Script subpackages
+------------------
+For information on contents of subpackages, see
+
+* :doc:`./scripts.i18n`
+* :doc:`./scripts.maintenance`
+* :doc:`./scripts.userscripts`
diff --git a/docs/scripts_ref/scripts.userscripts.rst b/docs/scripts_ref/scripts.userscripts.rst
index 60ac1d4..11f5130 100644
--- a/docs/scripts_ref/scripts.userscripts.rst
+++ b/docs/scripts_ref/scripts.userscripts.rst
@@ -1,5 +1,4 @@
-scripts.userscripts user scripts
-================================
+User scripts - scripts.userscripts
+==================================
.. automodule:: scripts.userscripts
-
diff --git a/docs/tests_ref/index.rst b/docs/tests_ref/index.rst
index c1eac79..b0d289c 100644
--- a/docs/tests_ref/index.rst
+++ b/docs/tests_ref/index.rst
@@ -1,5 +1,5 @@
===============
-Tests Reference
+Tests reference
===============
.. include:: ../../tests/README.rst
@@ -17,7 +17,7 @@
Library tests
*************
- Tests in this project:
+Tests in this project:
.. toctree::
:maxdepth: 1
@@ -90,7 +90,7 @@
Script tests
************
- Tests in this project:
+Tests in this project:
.. toctree::
:maxdepth: 1
diff --git a/docs/utilities/install.rst b/docs/utilities/install.rst
index dbf4134..794c9b9 100644
--- a/docs/utilities/install.rst
+++ b/docs/utilities/install.rst
@@ -1,4 +1,4 @@
-Installer Scripts
+Installer scripts
=================
make\_dist script
diff --git a/docs/utilities/scripts.rst b/docs/utilities/scripts.rst
index 9a957e6..5c179f6 100644
--- a/docs/utilities/scripts.rst
+++ b/docs/utilities/scripts.rst
@@ -1,53 +1,53 @@
-Framework Utility Scripts Description
+Framework utility scripts
=====================================
.. automodule:: pywikibot.scripts
:no-members:
:noindex:
-pwb wrapper script description
+pwb wrapper script
------------------------------
.. automodule:: pywikibot.scripts.wrapper
:no-members:
:noindex:
-generate\_family\_file script description
+generate\_family\_file script
-----------------------------------------
.. automodule:: pywikibot.scripts.generate_family_file
:no-members:
:noindex:
-generate\_user\_files script description
+generate\_user\_files script
----------------------------------------
.. automodule:: pywikibot.scripts.generate_user_files
:no-members:
:noindex:
-login script description
+login script
------------------------
.. automodule:: pywikibot.scripts.login
:no-members:
:noindex:
-preload_sites script description
+preload_sites script
--------------------------------
.. automodule:: pywikibot.scripts.preload_sites
:no-members:
:noindex:
-shell script description
+shell script
------------------------
.. automodule:: pywikibot.scripts.shell
:no-members:
:noindex:
-version script description
+version script
--------------------------
.. automodule:: pywikibot.scripts.version
diff --git a/docs/utilities/scripts_ref.rst b/docs/utilities/scripts_ref.rst
index 7f1346b..1b25394 100644
--- a/docs/utilities/scripts_ref.rst
+++ b/docs/utilities/scripts_ref.rst
@@ -1,5 +1,5 @@
-Framework Utility Scripts
-=========================
+Framework utility scripts reference
+===================================
.. automodule:: pywikibot.scripts
:synopsis: Folder which holds framework scripts
diff --git a/scripts/README.rst b/scripts/README.rst
index 2d65034..62b413e 100644
--- a/scripts/README.rst
+++ b/scripts/README.rst
@@ -3,180 +3,185 @@
===========================================================================
Some example robots are included.
----------------------------------
+=================================
These programs can actually modify the live wiki on the net, and proper
wiki-etiquette should be followed before running it on any wiki.
-To get started on proper usage of the bot framework, please refer to:
-
- `Manual:Pywikibot <https://www.mediawiki.org/wiki/Manual:Pywikibot>`_
+To get started on proper usage of the bot framework, refer to `Manual:Pywikibot <https://www.mediawiki.org/wiki/Manual:Pywikibot>`_.
The contents of the package
----------------------------
+===========================
- +----------------------------------------------------------------------------------+
- | Bots and Scripts |
- +========================+=========================================================+
- | add_text.py | Adds text at the top or end of pages. |
- +------------------------+---------------------------------------------------------+
- | archivebot.py | Archives discussion threads. |
- +------------------------+---------------------------------------------------------+
- | basic.py | Is a template from which simple bots can be made. |
- +------------------------+---------------------------------------------------------+
- | blockpagechecker.py | Deletes any protection templates that are on pages |
- | | which aren't actually protected. |
- +------------------------+---------------------------------------------------------+
- | category.py | Add a category link to all pages mentioned on a page, |
- | | change or remove category tags. |
- +------------------------+---------------------------------------------------------+
- | category_redirect.py | Maintain category redirects and replace links to |
- | | redirected categories. |
- +------------------------+---------------------------------------------------------+
- | change_pagelang.py | Changes the content language of pages. |
- +------------------------+---------------------------------------------------------+
- | checkimages.py | Check recently uploaded files. Checks if a file |
- | | description is present and if there are other problems |
- | | in the image's description. |
- +------------------------+---------------------------------------------------------+
- | claimit.py | Adds claims to Wikidata items based on categories. |
- +------------------------+---------------------------------------------------------+
- | clean_sandbox.py | This bot resets a sandbox with predefined text. |
- +------------------------+---------------------------------------------------------+
- | commonscat.py | Adds {{commonscat}} to Wikipedia categories (or |
- | | articles), if other language Wikipedia already has such |
- | | a template. |
- +------------------------+---------------------------------------------------------+
- | commons_information.py | Insert a language template into the description field. |
- +------------------------+---------------------------------------------------------+
- | coordinate_import.py | Coordinate importing script. |
- +------------------------+---------------------------------------------------------+
- | cosmetic_changes.py | Can do slight modifications to a wiki page source code |
- | | such that the code looks cleaner. |
- +------------------------+---------------------------------------------------------+
- | data_ingestion.py | A generic bot to do batch uploading to Commons. |
- +------------------------+---------------------------------------------------------+
- | delete.py | This script can be used to delete pages en masse. |
- +------------------------+---------------------------------------------------------+
- | delinker.py | Delink file references of deleted images. |
- +------------------------+---------------------------------------------------------+
- | djvutext.py | Extracts OCR text from djvu files and uploads onto |
- | | pages in the "Page" namespace on Wikisource. |
- +------------------------+---------------------------------------------------------+
- | download_dump.py | Downloads dumps from dumps.wikimedia.org |
- +------------------------+---------------------------------------------------------+
- | fixing_redirects.py | Correct all redirect links of processed pages. |
- +------------------------+---------------------------------------------------------+
- | harvest_template.py | Template harvesting script. |
- +------------------------+---------------------------------------------------------+
- | illustrate_wikidata.py | Bot to add images to Wikidata items. |
- +------------------------+---------------------------------------------------------+
- | image.py | Script to replace transclusions of files. |
- +------------------------+---------------------------------------------------------+
- | imagetransfer.py | Given a wiki page, check the interwiki links for |
- | | images, and let the user choose among them for |
- | | images to upload. |
- +------------------------+---------------------------------------------------------+
- | interwiki.py | A robot to check interwiki links on all pages (or |
- | | a range of pages) of a wiki. |
- +------------------------+---------------------------------------------------------+
- | interwikidata.py | Script to handle interwiki links based on Wikibase. |
- +------------------------+---------------------------------------------------------+
- | listpages.py | Print a list of pages, defined by a page generator. |
- +------------------------+---------------------------------------------------------+
- | misspelling.py | Similar to solve_disambiguation.py. It is supposed to |
- | | fix links that contain common spelling mistakes. |
- +------------------------+---------------------------------------------------------+
- | movepages.py | Bot that can move pages to another title. |
- +------------------------+---------------------------------------------------------+
- | newitem.py | Script creates new items on Wikidata based on criteria. |
- +------------------------+---------------------------------------------------------+
- | noreferences.py | Searches for pages where <references /> is missing |
- | | although a <ref> tag is present, and in that case adds |
- | | a new references section. |
- +------------------------+---------------------------------------------------------+
- | nowcommons.py | This bot can delete images with NowCommons template. |
- +------------------------+---------------------------------------------------------+
- | pagefromfile.py | This bot takes its input from a file that contains a |
- | | number of pages to be put on the wiki. |
- +------------------------+--+------------------------------------------------------+
- | parser_function_count.py | Find expensive templates that are subject to be |
- | | converted to Lua. |
- +------------------------+--+------------------------------------------------------+
- | patrol.py | Obtains a list pages and marks the edits as patrolled |
- | | based on a whitelist. |
- +------------------------+---------------------------------------------------------+
- | protect.py | Protect and unprotect pages en masse. |
- +------------------------+---------------------------------------------------------+
- | redirect.py | Fix double redirects and broken redirects. Note: |
- | | solve_disambiguation also has functions which treat |
- | | redirects. |
- +------------------------+---------------------------------------------------------+
- | reflinks.py | Search for references which are only made of a link |
- | | without title and fetch the html title from the link to |
- | | use it as the title of the wiki link in the reference. |
- +------------------------+---------------------------------------------------------+
- | replace.py | Search articles for a text and replace it by another |
- | | text. Both text are set in two configurable |
- | | text files. The bot can either work on a set of given |
- | | pages or crawl an SQL dump. |
- +------------------------+---------------------------------------------------------+
- | replicate_wiki.py | Replicates pages in wiki to a second wiki within family |
- +------------------------+---------------------------------------------------------+
- | revertbot.py | Script that can be used for reverting certain edits. |
- +------------------------+---------------------------------------------------------+
- | solve_disambiguation.py| Interactive robot doing disambiguation. |
- +------------------------+---------------------------------------------------------+
- | speedy_delete.py | Help sysops to quickly check and/or delete pages listed |
- | | for speedy deletion. |
- +------------------------+---------------------------------------------------------+
- | template.py | Change one template (that is {{...}}) into another. |
- +------------------------+---------------------------------------------------------+
- | templatecount.py | Display the list of pages transcluding a given list |
- | | of templates. |
- +------------------------+---------------------------------------------------------+
- | touch.py | Bot goes over all pages of the home wiki, and edits |
- | | them without changes. |
- +------------------------+---------------------------------------------------------+
- | transferbot.py | Transfers pages from a source wiki to a target wiki. |
- +------------------------+---------------------------------------------------------+
- | unusedfiles.py | Bot appends some text to all unused images and other |
- | | text to the respective uploaders. |
- +------------------------+---------------------------------------------------------+
- | upload.py | Upload an image to a wiki. |
- +------------------------+---------------------------------------------------------+
- | watchlists.py | Allows access to the account's watchlist. |
- +------------------------+---------------------------------------------------------+
- | weblinkchecker.py | Check if external links are still working. |
- +------------------------+---------------------------------------------------------+
- | welcome.py | Script to welcome new users. |
- +------------------------+---------------------------------------------------------+
+Bots and scripts
+----------------
++------------------------------------------------------------------------------------+
+| Bots and Scripts |
++==========================+=========================================================+
+| add_text.py | Adds text at the top or end of pages. |
++--------------------------+---------------------------------------------------------+
+| archivebot.py | Archives discussion threads. |
++--------------------------+---------------------------------------------------------+
+| basic.py | Is a template from which simple bots can be made. |
++--------------------------+---------------------------------------------------------+
+| blockpagechecker.py | Deletes any protection templates that are on pages |
+| | which aren't actually protected. |
++--------------------------+---------------------------------------------------------+
+| category.py | Add a category link to all pages mentioned on a page, |
+| | change or remove category tags. |
++--------------------------+---------------------------------------------------------+
+| category_redirect.py | Maintain category redirects and replace links to |
+| | redirected categories. |
++--------------------------+---------------------------------------------------------+
+| change_pagelang.py | Changes the content language of pages. |
++--------------------------+---------------------------------------------------------+
+| checkimages.py | Check recently uploaded files. Checks if a file |
+| | description is present and if there are other problems |
+| | in the image's description. |
++--------------------------+---------------------------------------------------------+
+| claimit.py | Adds claims to Wikidata items based on categories. |
++--------------------------+---------------------------------------------------------+
+| clean_sandbox.py | This bot resets a sandbox with predefined text. |
++--------------------------+---------------------------------------------------------+
+| commonscat.py | Adds {{commonscat}} to Wikipedia categories (or |
+| | articles), if other language Wikipedia already has such |
+| | a template. |
++--------------------------+---------------------------------------------------------+
+| commons_information.py | Insert a language template into the description field. |
++--------------------------+---------------------------------------------------------+
+| coordinate_import.py | Coordinate importing script. |
++--------------------------+---------------------------------------------------------+
+| cosmetic_changes.py | Can do slight modifications to a wiki page source code |
+| | such that the code looks cleaner. |
++--------------------------+---------------------------------------------------------+
+| data_ingestion.py | A generic bot to do batch uploading to Commons. |
++--------------------------+---------------------------------------------------------+
+| delete.py | This script can be used to delete pages en masse. |
++--------------------------+---------------------------------------------------------+
+| delinker.py | Delink file references of deleted images. |
++--------------------------+---------------------------------------------------------+
+| djvutext.py | Extracts OCR text from djvu files and uploads onto |
+| | pages in the "Page" namespace on Wikisource. |
++--------------------------+---------------------------------------------------------+
+| download_dump.py | Downloads dumps from dumps.wikimedia.org |
++--------------------------+---------------------------------------------------------+
+| fixing_redirects.py | Correct all redirect links of processed pages. |
++--------------------------+---------------------------------------------------------+
+| harvest_template.py | Template harvesting script. |
++--------------------------+---------------------------------------------------------+
+| illustrate_wikidata.py | Bot to add images to Wikidata items. |
++--------------------------+---------------------------------------------------------+
+| image.py | Script to replace transclusions of files. |
++--------------------------+---------------------------------------------------------+
+| imagetransfer.py | Given a wiki page, check the interwiki links for |
+| | images, and let the user choose among them for |
+| | images to upload. |
++--------------------------+---------------------------------------------------------+
+| interwiki.py | A robot to check interwiki links on all pages (or |
+| | a range of pages) of a wiki. |
++--------------------------+---------------------------------------------------------+
+| interwikidata.py | Script to handle interwiki links based on Wikibase. |
++--------------------------+---------------------------------------------------------+
+| listpages.py | Print a list of pages, defined by a page generator. |
++--------------------------+---------------------------------------------------------+
+| misspelling.py | Similar to solve_disambiguation.py. It is supposed to |
+| | fix links that contain common spelling mistakes. |
++--------------------------+---------------------------------------------------------+
+| movepages.py | Bot that can move pages to another title. |
++--------------------------+---------------------------------------------------------+
+| newitem.py | Script creates new items on Wikidata based on criteria. |
++--------------------------+---------------------------------------------------------+
+| noreferences.py | Searches for pages where <references /> is missing |
+| | although a <ref> tag is present, and in that case adds |
+| | a new references section. |
++--------------------------+---------------------------------------------------------+
+| nowcommons.py | This bot can delete images with NowCommons template. |
++--------------------------+---------------------------------------------------------+
+| pagefromfile.py | This bot takes its input from a file that contains a |
+| | number of pages to be put on the wiki. |
++--------------------------+---------------------------------------------------------+
+| parser_function_count.py | Find expensive templates that are subject to be |
+| | converted to Lua. |
++--------------------------+---------------------------------------------------------+
+| patrol.py | Obtains a list pages and marks the edits as patrolled |
+| | based on a whitelist. |
++--------------------------+---------------------------------------------------------+
+| protect.py | Protect and unprotect pages en masse. |
++--------------------------+---------------------------------------------------------+
+| redirect.py | Fix double redirects and broken redirects. Note: |
+| | solve_disambiguation also has functions which treat |
+| | redirects. |
++--------------------------+---------------------------------------------------------+
+| reflinks.py | Search for references which are only made of a link |
+| | without title and fetch the html title from the link to |
+| | use it as the title of the wiki link in the reference. |
++--------------------------+---------------------------------------------------------+
+| replace.py | Search articles for a text and replace it by another |
+| | text. Both text are set in two configurable |
+| | text files. The bot can either work on a set of given |
+| | pages or crawl an SQL dump. |
++--------------------------+---------------------------------------------------------+
+| replicate_wiki.py | Replicates pages in wiki to a second wiki within family |
++--------------------------+---------------------------------------------------------+
+| revertbot.py | Script that can be used for reverting certain edits. |
++--------------------------+---------------------------------------------------------+
+| solve_disambiguation.py | Interactive robot doing disambiguation. |
++--------------------------+---------------------------------------------------------+
+| speedy_delete.py | Help sysops to quickly check and/or delete pages listed |
+| | for speedy deletion. |
++--------------------------+---------------------------------------------------------+
+| template.py | Change one template (that is {{...}}) into another. |
++--------------------------+---------------------------------------------------------+
+| templatecount.py | Display the list of pages transcluding a given list |
+| | of templates. |
++--------------------------+---------------------------------------------------------+
+| touch.py | Bot goes over all pages of the home wiki, and edits |
+| | them without changes. |
++--------------------------+---------------------------------------------------------+
+| transferbot.py | Transfers pages from a source wiki to a target wiki. |
++--------------------------+---------------------------------------------------------+
+| unusedfiles.py | Bot appends some text to all unused images and other |
+| | text to the respective uploaders. |
++--------------------------+---------------------------------------------------------+
+| upload.py | Upload an image to a wiki. |
++--------------------------+---------------------------------------------------------+
+| watchlists.py | Allows access to the account's watchlist. |
++--------------------------+---------------------------------------------------------+
+| weblinkchecker.py | Check if external links are still working. |
++--------------------------+---------------------------------------------------------+
+| welcome.py | Script to welcome new users. |
++--------------------------+---------------------------------------------------------+
- +------------------------+---------------------------------------------------------+
- | maintenance | Framework helper scripts. . |
- +========================+=========================================================+
- | cache.py | Script for showing and deleting API cache. |
- +------------------------+---------------------------------------------------------+
- | colors.py | Utility to show pywikibot colors. |
- +------------------------+---------------------------------------------------------+
- | make_i18n_dict.py | Generate an i18n file from a given script. |
- +------------------------+---------------------------------------------------------+
- | sorting_order.py | Updates interwiki sorting order in family.py file. |
- +------------------------+---------------------------------------------------------+
- | wikimedia_sites.py | Updates the language lists in Wikimedia family files. |
- +------------------------+---------------------------------------------------------+
+Maintenance
+-----------
++------------------------+---------------------------------------------------------+
+| maintenance | Framework helper scripts |
++========================+=========================================================+
+| cache.py | Script for showing and deleting API cache. |
++------------------------+---------------------------------------------------------+
+| colors.py | Utility to show pywikibot colors. |
++------------------------+---------------------------------------------------------+
+| make_i18n_dict.py | Generate an i18n file from a given script. |
++------------------------+---------------------------------------------------------+
+| sorting_order.py | Updates interwiki sorting order in family.py file. |
++------------------------+---------------------------------------------------------+
+| wikimedia_sites.py | Updates the language lists in Wikimedia family files. |
++------------------------+---------------------------------------------------------+
- +------------------------+---------------------------------------------------------+
- | Others | |
- +========================+=========================================================+
- | i18n (folder) | Contains i18n translations for bot edit summaries. |
- +------------------------+---------------------------------------------------------+
- | userscripts (folder) | Empty folder for user scripts. |
- +------------------------+---------------------------------------------------------+
- | README.rst | This file (Short info of all scripts). |
- +------------------------+---------------------------------------------------------+
+Others
+------
+
++------------------------+---------------------------------------------------------+
+| Others | |
++========================+=========================================================+
+| i18n (folder) | Contains i18n translations for bot edit summaries. |
++------------------------+---------------------------------------------------------+
+| userscripts (folder) | Empty folder for user scripts. |
++------------------------+---------------------------------------------------------+
+| README.rst | This file (Short info of all scripts). |
++------------------------+---------------------------------------------------------+
**External packages could be required with Pywikibot:**
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/860982
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I810d27449a43aba1e361bab64aab3a42618efe30
Gerrit-Change-Number: 860982
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-CC: KBach <kbach(a)wikimedia.org>
Gerrit-MessageType: merged