wikidot 3.1.0.dev11__tar.gz → 3.1.0.dev13__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {wikidot-3.1.0.dev11/src/wikidot.egg-info → wikidot-3.1.0.dev13}/PKG-INFO +4 -3
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/pyproject.toml +2 -2
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/__init__.py +1 -1
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/client.py +3 -1
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/page.py +3 -1
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/page_revision.py +3 -1
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/user.py +10 -3
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13/src/wikidot.egg-info}/PKG-INFO +4 -3
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot.egg-info/requires.txt +1 -1
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/LICENSE +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/MANIFEST.in +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/README.md +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/setup.cfg +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/common/__init__.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/common/decorators.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/common/exceptions.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/common/logger.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/connector/__init__.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/connector/ajax.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/connector/api.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/__init__.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/auth.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/forum_category.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/forum_post.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/forum_thread.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/page_source.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/page_votes.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/private_message.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/site.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/site_application.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/module/site_member.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/__init__.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/parser/__init__.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/parser/odate.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/parser/user.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/quick_module.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/requestutil.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/stringutil.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/table/__init__.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot/util/table/char_table.py +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot.egg-info/SOURCES.txt +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot.egg-info/dependency_links.txt +0 -0
- {wikidot-3.1.0.dev11 → wikidot-3.1.0.dev13}/src/wikidot.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: wikidot
|
|
3
|
-
Version: 3.1.0.
|
|
3
|
+
Version: 3.1.0.dev13
|
|
4
4
|
Summary: Wikidot Utility Library
|
|
5
5
|
Author-email: ukwhatn <ukwhatn@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/ukwhatn/wikidot.py
|
|
@@ -15,7 +15,7 @@ Description-Content-Type: text/markdown
|
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: httpx<0.29,>=0.25
|
|
17
17
|
Requires-Dist: beautifulsoup4<4.14.0,>=4.12.2
|
|
18
|
-
Requires-Dist: lxml<5.
|
|
18
|
+
Requires-Dist: lxml<5.5.0,>=4.9.3
|
|
19
19
|
Provides-Extra: build
|
|
20
20
|
Requires-Dist: build; extra == "build"
|
|
21
21
|
Requires-Dist: twine; extra == "build"
|
|
@@ -30,6 +30,7 @@ Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "docs"
|
|
|
30
30
|
Requires-Dist: sphinx-intl>=2.1.0; extra == "docs"
|
|
31
31
|
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
|
|
32
32
|
Requires-Dist: sphinx-autodoc-typehints>=1.25.3; extra == "docs"
|
|
33
|
+
Dynamic: license-file
|
|
33
34
|
|
|
34
35
|
# wikidot.py
|
|
35
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "wikidot"
|
|
3
|
-
version = "3.1.
|
|
3
|
+
version = "3.1.0dev13"
|
|
4
4
|
authors = [{ name = "ukwhatn", email = "ukwhatn@gmail.com" }]
|
|
5
5
|
description = "Wikidot Utility Library"
|
|
6
6
|
readme = "README.md"
|
|
@@ -16,7 +16,7 @@ classifiers = [
|
|
|
16
16
|
dependencies = [
|
|
17
17
|
"httpx >= 0.25,< 0.29",
|
|
18
18
|
"beautifulsoup4 >= 4.12.2,< 4.14.0",
|
|
19
|
-
"lxml >= 4.9.3,< 5.
|
|
19
|
+
"lxml >= 4.9.3,< 5.5.0",
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
[project.optional-dependencies]
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from ..common import wd_logger
|
|
2
4
|
from ..common.exceptions import LoginRequiredException
|
|
3
5
|
from ..connector.ajax import AjaxModuleConnectorClient, AjaxModuleConnectorConfig
|
|
@@ -31,7 +33,7 @@ class ClientUserMethods:
|
|
|
31
33
|
"""
|
|
32
34
|
self.client = client
|
|
33
35
|
|
|
34
|
-
def get(self, name: str, raise_when_not_found: bool = False) -> "AbstractUser":
|
|
36
|
+
def get(self, name: str, raise_when_not_found: bool = False) -> Optional["AbstractUser"]:
|
|
35
37
|
"""
|
|
36
38
|
ユーザー名からユーザーオブジェクトを取得する
|
|
37
39
|
|
|
@@ -477,11 +477,13 @@ class PageCollection(list["Page"]):
|
|
|
477
477
|
|
|
478
478
|
for page, responses in zip(pages, responses):
|
|
479
479
|
body = responses.json()["body"]
|
|
480
|
+
# nbspをスペースに置換
|
|
481
|
+
body = body.replace(" ", " ")
|
|
480
482
|
html = BeautifulSoup(body, "lxml")
|
|
481
483
|
source_element = html.select_one("div.page-source")
|
|
482
484
|
if source_element is None:
|
|
483
485
|
raise exceptions.NoElementException("Cannot find source element")
|
|
484
|
-
source = source_element.
|
|
486
|
+
source = source_element.get_text().strip().removeprefix("\t")
|
|
485
487
|
page.source = PageSource(page, source)
|
|
486
488
|
return pages
|
|
487
489
|
|
|
@@ -111,13 +111,15 @@ class PageRevisionCollection(list["PageRevision"]):
|
|
|
111
111
|
|
|
112
112
|
for revision, response in zip(target_revisions, responses):
|
|
113
113
|
body = response.json()["body"]
|
|
114
|
+
# nbspをスペースに置換
|
|
115
|
+
body = body.replace(" ", " ")
|
|
114
116
|
body_html = BeautifulSoup(body, "lxml")
|
|
115
117
|
wiki_text_elem = body_html.select_one("div.page-source")
|
|
116
118
|
if wiki_text_elem is None:
|
|
117
119
|
raise NoElementException("Wiki text element not found")
|
|
118
120
|
revision.source = PageSource(
|
|
119
121
|
page=page,
|
|
120
|
-
wiki_text=wiki_text_elem.
|
|
122
|
+
wiki_text=wiki_text_elem.get_text().strip(),
|
|
121
123
|
)
|
|
122
124
|
|
|
123
125
|
return revisions
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from collections.abc import Iterator
|
|
2
2
|
from dataclasses import dataclass
|
|
3
|
-
from typing import TYPE_CHECKING
|
|
3
|
+
from typing import TYPE_CHECKING, Optional
|
|
4
4
|
|
|
5
5
|
from bs4 import BeautifulSoup
|
|
6
6
|
|
|
@@ -181,7 +181,7 @@ class User(AbstractUser):
|
|
|
181
181
|
ip: str | None = None
|
|
182
182
|
|
|
183
183
|
@staticmethod
|
|
184
|
-
def from_name(client: "Client", name: str, raise_when_not_found: bool = False) -> "AbstractUser":
|
|
184
|
+
def from_name(client: "Client", name: str, raise_when_not_found: bool = False) -> Optional["AbstractUser"]:
|
|
185
185
|
"""
|
|
186
186
|
ユーザー名からユーザーオブジェクトを取得する
|
|
187
187
|
|
|
@@ -209,7 +209,14 @@ class User(AbstractUser):
|
|
|
209
209
|
IndexError
|
|
210
210
|
ユーザーが見つからない場合(raise_when_not_foundがFalseの場合)
|
|
211
211
|
"""
|
|
212
|
-
|
|
212
|
+
result = UserCollection.from_names(client, [name], raise_when_not_found)
|
|
213
|
+
if len(result) == 0:
|
|
214
|
+
if raise_when_not_found:
|
|
215
|
+
raise NotFoundException(f"User not found: {name}")
|
|
216
|
+
else:
|
|
217
|
+
return None
|
|
218
|
+
|
|
219
|
+
return result[0]
|
|
213
220
|
|
|
214
221
|
|
|
215
222
|
@dataclass
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: wikidot
|
|
3
|
-
Version: 3.1.0.
|
|
3
|
+
Version: 3.1.0.dev13
|
|
4
4
|
Summary: Wikidot Utility Library
|
|
5
5
|
Author-email: ukwhatn <ukwhatn@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/ukwhatn/wikidot.py
|
|
@@ -15,7 +15,7 @@ Description-Content-Type: text/markdown
|
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: httpx<0.29,>=0.25
|
|
17
17
|
Requires-Dist: beautifulsoup4<4.14.0,>=4.12.2
|
|
18
|
-
Requires-Dist: lxml<5.
|
|
18
|
+
Requires-Dist: lxml<5.5.0,>=4.9.3
|
|
19
19
|
Provides-Extra: build
|
|
20
20
|
Requires-Dist: build; extra == "build"
|
|
21
21
|
Requires-Dist: twine; extra == "build"
|
|
@@ -30,6 +30,7 @@ Requires-Dist: sphinx-rtd-theme>=2.0.0; extra == "docs"
|
|
|
30
30
|
Requires-Dist: sphinx-intl>=2.1.0; extra == "docs"
|
|
31
31
|
Requires-Dist: myst-parser>=2.0.0; extra == "docs"
|
|
32
32
|
Requires-Dist: sphinx-autodoc-typehints>=1.25.3; extra == "docs"
|
|
33
|
+
Dynamic: license-file
|
|
33
34
|
|
|
34
35
|
# wikidot.py
|
|
35
36
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|