Xqt submitted this change.

View Change

Approvals: Xqt: Verified; Looks good to me, approved
[FIX] Enable site-package installation from git repository (Part 1)

This patch is used to keep blame history.
Only submit it together with part 2.

Bug: T320851
Change-Id: I44b6298d26625e2d2ca37932f6bcce730a6012e5
---
M CONTENT.rst
A call_pwb.py
M docs/utilities/install.rst
M docs/utilities/scripts.rst
M docs/utilities/scripts_ref.rst
M pywikibot/CONTENT.rst
A pywikibot/scripts/i18n/__init__.py
A pywikibot/scripts/i18n/pywikibot/en.json
R pywikibot/scripts/wrapper.py
M setup.py
M tox.ini
11 files changed, 61 insertions(+), 9 deletions(-)

diff --git a/CONTENT.rst b/CONTENT.rst
index d2c2b63..4e1e329 100644
--- a/CONTENT.rst
+++ b/CONTENT.rst
@@ -24,7 +24,7 @@
+---------------------------+-----------------------------------------------------------+
| MANIFEST.in | Setup file for package data |
+---------------------------+-----------------------------------------------------------+
- | pwb.py | Code entry wrapper script (directory mode only) |
+ | pwb.py | Caller script for pwb wrapper script |
+---------------------------+-----------------------------------------------------------+
| README.rst | Short info string used by Pywikibot Nightlies |
+---------------------------+-----------------------------------------------------------+
diff --git a/call_pwb.py b/call_pwb.py
new file mode 100644
index 0000000..a5d7764
--- /dev/null
+++ b/call_pwb.py
@@ -0,0 +1,15 @@
+"""pwb caller script to invoke the :mod:`pywikibot.scripts.wrapper` script.
+
+.. versionadded:: 8.0
+"""
+#
+# (C) Pywikibot team, 2022
+#
+# Distributed under the terms of the MIT license.
+#
+import sys
+
+from pywikibot.scripts.wrapper import main
+
+if __name__ == '__main__':
+ sys.exit(main())
diff --git a/docs/utilities/install.rst b/docs/utilities/install.rst
index f9530c7..475109e 100644
--- a/docs/utilities/install.rst
+++ b/docs/utilities/install.rst
@@ -9,4 +9,4 @@
setup script
------------

-.. automodule:: setup
\ No newline at end of file
+.. automodule:: setup
diff --git a/docs/utilities/scripts.rst b/docs/utilities/scripts.rst
index 54b2f56..9a957e6 100644
--- a/docs/utilities/scripts.rst
+++ b/docs/utilities/scripts.rst
@@ -8,7 +8,7 @@
pwb wrapper script description
------------------------------

-.. automodule:: pwb
+.. automodule:: pywikibot.scripts.wrapper
:no-members:
:noindex:

diff --git a/docs/utilities/scripts_ref.rst b/docs/utilities/scripts_ref.rst
index 5b5add8..7f1346b 100644
--- a/docs/utilities/scripts_ref.rst
+++ b/docs/utilities/scripts_ref.rst
@@ -8,7 +8,7 @@
pwb wrapper script
------------------

-.. automodule:: pwb
+.. automodule:: pywikibot.scripts.wrapper
:synopsis: Wrapper script to invoke pywikibot-based scripts

generate\_family\_file script
diff --git a/pywikibot/CONTENT.rst b/pywikibot/CONTENT.rst
index 477e85f..52ba21a 100644
--- a/pywikibot/CONTENT.rst
+++ b/pywikibot/CONTENT.rst
@@ -162,15 +162,15 @@
| | 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 |
| | imported |
+----------------------------+------------------------------------------------------+
| version.py | Outputs Pywikibot's revision number, Python's |
| | version and OS used. |
+----------------------------+------------------------------------------------------+
- | i18n (folder) | Contains i18n translations (site-package only) |
+ | wrapper.py | Code entry wrapper script |
+ +----------------------------+------------------------------------------------------+
+ | i18n (folder) | Contains i18n translations |
+----------------------------+------------------------------------------------------+


diff --git a/pywikibot/scripts/i18n/__init__.py b/pywikibot/scripts/i18n/__init__.py
new file mode 100644
index 0000000..8bd476e
--- /dev/null
+++ b/pywikibot/scripts/i18n/__init__.py
@@ -0,0 +1,12 @@
+"""Folder containing i18n translations bundles.
+
+This file exists to help pkgutil find the i18n data. There is no actual
+python code in this package.
+"""
+#
+# (C) Pywikibot team, 2011-2022
+#
+# Distributed under the terms of the MIT license.
+#
+# Translations by translators are licensed CC BY 3.0
+#
diff --git a/pywikibot/scripts/i18n/pywikibot/en.json b/pywikibot/scripts/i18n/pywikibot/en.json
new file mode 100644
index 0000000..d731bfe
--- /dev/null
+++ b/pywikibot/scripts/i18n/pywikibot/en.json
@@ -0,0 +1,25 @@
+{
+ "@metadata": {
+ "authors": [
+ "Daniel Herding",
+ "Huji",
+ "Siebrand",
+ "Revi",
+ "Russell Blau",
+ "Xqt"
+ ]
+ },
+ "pywikibot-cosmetic-changes": "; cosmetic changes",
+ "pywikibot-enter-category-name": "Please enter the category name:",
+ "pywikibot-enter-file-links-processing": "Links to which file page should be processed?",
+ "pywikibot-enter-finished-browser": "Press Enter when finished in browser.",
+ "pywikibot-enter-namespace-number": "Please enter a namespace by its number:",
+ "pywikibot-enter-new-text": "Please enter the new text:",
+ "pywikibot-enter-page-processing": "Which page should be processed?",
+ "pywikibot-enter-xml-filename": "Please enter the XML dump's filename:",
+ "pywikibot-fixes-fckeditor": "Bot: Fixing rich-editor html",
+ "pywikibot-fixes-isbn": "Bot: Formatting ISBN",
+ "pywikibot-fixes-html": "Bot: Converting/fixing HTML",
+ "pywikibot-fixes-syntax": "Bot: Fixing wiki syntax",
+ "pywikibot-touch": "Pywikibot touch edit"
+}
diff --git a/pwb.py b/pywikibot/scripts/wrapper.py
similarity index 100%
rename from pwb.py
rename to pywikibot/scripts/wrapper.py
diff --git a/setup.py b/setup.py
index 6e1550c..cfd23a5 100755
--- a/setup.py
+++ b/setup.py
@@ -289,7 +289,7 @@
},
entry_points={
'console_scripts': [
- 'pwb = pywikibot.scripts.pwb:run',
+ 'pwb = pywikibot.scripts.wrapper:run',
],
},
classifiers=[
diff --git a/tox.ini b/tox.ini
index a48871b..6d7c8ec 100644
--- a/tox.ini
+++ b/tox.ini
@@ -129,7 +129,6 @@
# N816: mixedCase variable in global scope

per-file-ignores =
- pwb.py: FI53, T001, T201
pywikibot/__init__.py: N802, N806
pywikibot/_wbtypes.py: N802
pywikibot/backports.py: F401
@@ -151,6 +150,7 @@
pywikibot/pagegenerators/_filters.py: N802
pywikibot/pagegenerators/_generators.py: N802
pywikibot/scripts/generate_family_file.py: T001, T201
+ pywikibot/scripts/wrapper.py: FI53, T001, T201
pywikibot/site/_datasite.py: N802
pywikibot/textlib.py: N801, N802, N803, N806
pywikibot/throttle.py: N802

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

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