jenkins-bot submitted this change.

View Change

Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
[IMPR] Move preload_sites.py to pywikibot/scripts folder

Bug: T308912
Change-Id: I02258cff93469624aa9fc4e222920d6d22d80c7f
---
M .codecov.yml
M docs/faq.rst
M docs/scripts/maintenance.rst
M docs/scripts_ref/scripts.maintenance.rst
M docs/utilities/scripts.rst
M docs/utilities/scripts_ref.rst
M pywikibot/CONTENT.rst
R pywikibot/scripts/preload_sites.py
M scripts/README.rst
9 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/.codecov.yml b/.codecov.yml
index f1a70ae..1742cae 100644
--- a/.codecov.yml
+++ b/.codecov.yml
@@ -30,12 +30,12 @@
- pywikibot/backports.py
- pywikibot/daemonize.py
- pywikibot/families/__init__.py
+ - pywikibot/scripts/preload_sites.py
- pywikibot/scripts/version.py
- pywikibot/userinterfaces/win32_unicode.py
- scripts/dataextend.py
- scripts/maintenance/colors.py
- scripts/maintenance/make_i18n_dict.py
- - scripts/maintenance/preload_sites.py
- scripts/maintenance/sorting_order.py
- scripts/maintenance/wikimedia_sites.py
- scripts/userscripts/
diff --git a/docs/faq.rst b/docs/faq.rst
index f7aca82..aeb515f 100644
--- a/docs/faq.rst
+++ b/docs/faq.rst
@@ -2,7 +2,7 @@
========================
**How to speed up Pywikibot?**
1. The first time you are using Pywikibot for multiple Wikimedia sites you
- can run :py:mod:`preload_sites <scripts.maintenance.preload_sites>` script
+ can run :py:mod:`preload_sites <pywikibot.scripts.preload_sites>` script
to preload site info quickly.
2. If you need the content, use :py:mod:`PreloadingGenerator
<pywikibot.pagegenerators.PreloadingGenerator>` with page generators,
diff --git a/docs/scripts/maintenance.rst b/docs/scripts/maintenance.rst
index 6f3ed7d..9710629 100644
--- a/docs/scripts/maintenance.rst
+++ b/docs/scripts/maintenance.rst
@@ -13,12 +13,6 @@
.. automodule:: scripts.maintenance.colors
:no-members:

-preload_sites script description
---------------------------------
-
-.. automodule:: scripts.maintenance.preload_sites
- :no-members:
-
sorting\_order script description
---------------------------------

diff --git a/docs/scripts_ref/scripts.maintenance.rst b/docs/scripts_ref/scripts.maintenance.rst
index c331693..93770a9 100644
--- a/docs/scripts_ref/scripts.maintenance.rst
+++ b/docs/scripts_ref/scripts.maintenance.rst
@@ -22,11 +22,6 @@

.. automodule:: scripts.maintenance.make_i18n_dict

-scripts.maintenance.preload_sites script
------------------------------------------
-
-.. automodule:: scripts.maintenance.preload_sites
-
scripts.maintenance.sorting\_order script
-----------------------------------------

diff --git a/docs/utilities/scripts.rst b/docs/utilities/scripts.rst
index 71b096f..d47ea1b 100644
--- a/docs/utilities/scripts.rst
+++ b/docs/utilities/scripts.rst
@@ -22,6 +22,12 @@
.. automodule:: pywikibot.scripts.generate_user_files
:no-members:

+preload_sites script
+--------------------
+
+.. automodule:: pywikibot.scripts.preload_sites
+ :no-members:
+
shell script
------------

diff --git a/docs/utilities/scripts_ref.rst b/docs/utilities/scripts_ref.rst
index 253e8ca..5188659 100644
--- a/docs/utilities/scripts_ref.rst
+++ b/docs/utilities/scripts_ref.rst
@@ -19,6 +19,11 @@

.. automodule:: pywikibot.scripts.generate_user_files

+preload_sites script
+--------------------
+
+.. automodule:: pywikibot.scripts.preload_sites
+
shell script
------------

diff --git a/pywikibot/CONTENT.rst b/pywikibot/CONTENT.rst
index 78a27be..cf03bbc 100644
--- a/pywikibot/CONTENT.rst
+++ b/pywikibot/CONTENT.rst
@@ -129,6 +129,10 @@
+----------------------------+------------------------------------------------------+
| generate_user_files.py | Creates user-config.py or user-fixes.py |
+----------------------------+------------------------------------------------------+
+ | preload_sites.py | Preload and cache site information for each |
+ | | WikiMedia family within seconds. Useful for bots |
+ | | running on multiple sites. |
+ +----------------------------+------------------------------------------------------+
| pwb.py | Code entry wrapper script (site-package only) |
+----------------------------+------------------------------------------------------+
| shell.py | Spawns an interactive Python shell with pywikibot |
diff --git a/scripts/maintenance/preload_sites.py b/pywikibot/scripts/preload_sites.py
similarity index 94%
rename from scripts/maintenance/preload_sites.py
rename to pywikibot/scripts/preload_sites.py
index 5e0743b..1d06a27 100755
--- a/scripts/maintenance/preload_sites.py
+++ b/pywikibot/scripts/preload_sites.py
@@ -6,14 +6,16 @@
-worker:<num> The number of parallel tasks to be run. Default is the
number of processors on the machine

-Usage:
+Usage::

python pwb.py preload_sites [{<family>}] [-worker:{<num>}]

-To force preloading, change the global expiry value to 0:
+To force preloading, change the global expiry value to 0::

python pwb.py -API_config_expiry:0 preload_sites [{<family>}]

+.. versionchanged:: 7.4
+ script was moved to the framework scripts folder.
"""
#
# (C) Pywikibot team, 2021-2022
diff --git a/scripts/README.rst b/scripts/README.rst
index 1253758..99d6d38 100644
--- a/scripts/README.rst
+++ b/scripts/README.rst
@@ -164,9 +164,6 @@
+------------------------+---------------------------------------------------------+
| make_i18n_dict.py | Generate an i18n file from a given script. |
+------------------------+---------------------------------------------------------+
- | preload_sites.py | Preload and cache site information for each WikiMedia |
- | | family. Useful for bots running on multiple sites. |
- +------------------------+---------------------------------------------------------+
| sorting_order.py | Updates interwiki sorting order in family.py file. |
+------------------------+---------------------------------------------------------+
| wikimedia_sites.py | Updates the language lists in Wikimedia family files. |

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

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I02258cff93469624aa9fc4e222920d6d22d80c7f
Gerrit-Change-Number: 794477
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged