wikidot 3.1.0.dev10__tar.gz → 3.1.0.dev12__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.dev10/src/wikidot.egg-info → wikidot-3.1.0.dev12}/PKG-INFO +3 -2
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/pyproject.toml +1 -1
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/__init__.py +1 -1
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/common/decorators.py +12 -1
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/client.py +3 -1
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/user.py +10 -3
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12/src/wikidot.egg-info}/PKG-INFO +3 -2
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/LICENSE +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/MANIFEST.in +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/README.md +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/setup.cfg +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/common/__init__.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/common/exceptions.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/common/logger.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/connector/__init__.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/connector/ajax.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/connector/api.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/__init__.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/auth.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/forum_category.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/forum_post.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/forum_thread.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/page.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/page_revision.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/page_source.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/page_votes.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/private_message.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/site.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/site_application.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/module/site_member.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/__init__.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/parser/__init__.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/parser/odate.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/parser/user.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/quick_module.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/requestutil.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/stringutil.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/table/__init__.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot/util/table/char_table.py +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot.egg-info/SOURCES.txt +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot.egg-info/dependency_links.txt +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/src/wikidot.egg-info/requires.txt +0 -0
- {wikidot-3.1.0.dev10 → wikidot-3.1.0.dev12}/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.dev12
|
|
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
|
|
@@ -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
|
|
|
@@ -19,6 +19,7 @@ def login_required(func):
|
|
|
19
19
|
1. client という名前の引数
|
|
20
20
|
2. Client クラスのインスタンスである引数
|
|
21
21
|
3. self.client(呼び出し元オブジェクトの属性)
|
|
22
|
+
4. selfが持つ属性が持つclientクラス(例:self.site.client)
|
|
22
23
|
|
|
23
24
|
Parameters
|
|
24
25
|
----------
|
|
@@ -52,9 +53,19 @@ def login_required(func):
|
|
|
52
53
|
break
|
|
53
54
|
|
|
54
55
|
# selfに存在するか?
|
|
55
|
-
if client is None:
|
|
56
|
+
if client is None and args:
|
|
56
57
|
if hasattr(args[0], "client"):
|
|
57
58
|
client = args[0].client
|
|
59
|
+
else:
|
|
60
|
+
# selfが持つ属性にclientが存在するか探索する
|
|
61
|
+
for attr_name in dir(args[0]):
|
|
62
|
+
if attr_name.startswith("_"):
|
|
63
|
+
continue
|
|
64
|
+
attr = getattr(args[0], attr_name)
|
|
65
|
+
if hasattr(attr, "client"):
|
|
66
|
+
client = getattr(attr, "client")
|
|
67
|
+
if isinstance(client, Client):
|
|
68
|
+
break
|
|
58
69
|
|
|
59
70
|
if client is None:
|
|
60
71
|
raise ValueError("Client is not found")
|
|
@@ -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
|
|
|
@@ -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.dev12
|
|
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
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|