Xqt has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/656564 )
Change subject: [IMPR] Move APISite to _apisite.py file (part 2)
......................................................................
[IMPR] Move APISite to _apisite.py file (part 2)
Re-add site/__init__.py
Change-Id: Ic8cc3f0fe32a8ee28d4837bf7a12308d6dee4cb2
---
M docs/api_ref/pywikibot.site.rst
M pywikibot/CONTENT.rst
A pywikibot/site/__init__.py
M pywikibot/site/_apisite.py
M tox.ini
5 files changed, 32 insertions(+), 13 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/docs/api_ref/pywikibot.site.rst b/docs/api_ref/pywikibot.site.rst
index d74f919..8fe4299 100644
--- a/docs/api_ref/pywikibot.site.rst
+++ b/docs/api_ref/pywikibot.site.rst
@@ -6,6 +6,11 @@
Submodules
----------
+pywikibot.site.\_apisite module
+-------------------------------
+
+.. automodule:: pywikibot.site._apisite
+
pywikibot.site.\_basesite module
--------------------------------
diff --git a/pywikibot/CONTENT.rst b/pywikibot/CONTENT.rst
index a0f8036..d158d1d 100644
--- a/pywikibot/CONTENT.rst
+++ b/pywikibot/CONTENT.rst
@@ -113,7 +113,9 @@
+============================+======================================================+
| __init__.py | Objects representing MediaWiki sites
(wikis) |
+----------------------------+------------------------------------------------------+
- | _basesite.py | Objects representingsite methods
independent of the |
+ | _apisite.py | Objects representing API interface to
MediaWiki site |
+
+----------------------------+------------------------------------------------------+
+ | _basesite.py | Objects representing site methods
independent of the |
| | communication interface
|
+----------------------------+------------------------------------------------------+
| _decorators.py | Decorators used by site models
|
diff --git a/pywikibot/site/__init__.py b/pywikibot/site/__init__.py
new file mode 100644
index 0000000..5a74082
--- /dev/null
+++ b/pywikibot/site/__init__.py
@@ -0,0 +1,18 @@
+# -*- coding: utf-8 -*-
+"""Library module representing MediaWiki sites (wikis)."""
+#
+# (C) Pywikibot team, 2021
+#
+# Distributed under the terms of the MIT license.
+#
+from pywikibot.site._apisite import APISite, ClosedSite, DataSite
+from pywikibot.site._basesite import BaseSite, PageInUse, RemovedSite
+from pywikibot.site._namespace import Namespace, NamespacesDict
+from pywikibot.site._siteinfo import Siteinfo
+from pywikibot.site._tokenwallet import TokenWallet
+
+__all__ = ('APISite', 'BaseSite', 'ClosedSite', 'DataSite', 'RemovedSite',
+ 'Namespace', 'NamespacesDict', 'PageInUse', 'Siteinfo',
+ 'TokenWallet')
+
+_logger = 'wiki.site'
diff --git a/pywikibot/site/_apisite.py b/pywikibot/site/_apisite.py
index 5eb991e..0767a30 100644
--- a/pywikibot/site/_apisite.py
+++ b/pywikibot/site/_apisite.py
@@ -1,9 +1,4 @@
-"""
-Objects representing MediaWiki sites (wikis).
-
-This module also includes functions to load families, which are
-groups of wikis on the same topic in different languages.
-"""
+"""Objects representing API interface to MediaWiki site."""
#
# (C) Pywikibot team, 2008-2021
#
@@ -63,10 +58,10 @@
UserRightsError,
UnknownExtension,
)
-from pywikibot.site._basesite import BaseSite, PageInUse, RemovedSite
+from pywikibot.site._basesite import BaseSite
from pywikibot.site._decorators import need_extension, need_right, need_version
from pywikibot.site._interwikimap import _InterwikiMap
-from pywikibot.site._namespace import Namespace, NamespacesDict
+from pywikibot.site._namespace import Namespace
from pywikibot.site._siteinfo import Siteinfo
from pywikibot.site._tokenwallet import TokenWallet
from pywikibot.tools import (
@@ -84,10 +79,9 @@
)
-__all__ = ('APISite', 'DataSite', 'Namespace', 'NamespacesDict', 'PageInUse',
- 'RemovedSite', 'Siteinfo', 'TokenWallet')
+__all__ = ('APISite', 'ClosedSite', 'DataSite')
-_logger = 'wiki.site'
+_logger = 'wiki.apisite'
_mw_msg_cache = defaultdict(dict)
diff --git a/tox.ini b/tox.ini
index 8352fab..c5b281d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -149,7 +149,7 @@
pywikibot/login.py: N802, N816
pywikibot/page/__init__.py: N802
pywikibot/pagegenerators.py : N802, N803, N806, N816
- pywikibot/site/__init__.py: N802, N815
+ pywikibot/site/_apisite.py: N802
pywikibot/specialbots/__init__.py : F401
pywikibot/textlib.py : N801, N802, N803, N806, N816
pywikibot/throttle.py: N802
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/656564
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: Ic8cc3f0fe32a8ee28d4837bf7a12308d6dee4cb2
Gerrit-Change-Number: 656564
Gerrit-PatchSet: 5
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits