p115client 0.0.5.11.6__py3-none-any.whl → 0.0.5.11.7.1__py3-none-any.whl
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.
- p115client/client.py +83 -28
- p115client/const.py +2 -6
- p115client/tool/attr.py +2 -2
- p115client/tool/download.py +16 -16
- p115client/tool/iterdir.py +86 -86
- p115client/tool/pool.py +2 -3
- {p115client-0.0.5.11.6.dist-info → p115client-0.0.5.11.7.1.dist-info}/METADATA +2 -2
- {p115client-0.0.5.11.6.dist-info → p115client-0.0.5.11.7.1.dist-info}/RECORD +10 -10
- {p115client-0.0.5.11.6.dist-info → p115client-0.0.5.11.7.1.dist-info}/LICENSE +0 -0
- {p115client-0.0.5.11.6.dist-info → p115client-0.0.5.11.7.1.dist-info}/WHEEL +0 -0
p115client/client.py
CHANGED
@@ -766,7 +766,7 @@ def normalize_attr_app[D: dict[str, Any]](
|
|
766
766
|
simple: bool = False,
|
767
767
|
keep_raw: bool = False,
|
768
768
|
*,
|
769
|
-
dict_cls:
|
769
|
+
dict_cls: type[D],
|
770
770
|
) -> D:
|
771
771
|
...
|
772
772
|
def normalize_attr_app[D: dict[str, Any]](
|
@@ -896,7 +896,7 @@ def normalize_attr_app2[D: dict[str, Any]](
|
|
896
896
|
simple: bool = False,
|
897
897
|
keep_raw: bool = False,
|
898
898
|
*,
|
899
|
-
dict_cls:
|
899
|
+
dict_cls: type[D],
|
900
900
|
) -> D:
|
901
901
|
...
|
902
902
|
def normalize_attr_app2[D: dict[str, Any]](
|
@@ -1082,7 +1082,7 @@ def normalize_attr_simple(
|
|
1082
1082
|
/,
|
1083
1083
|
keep_raw: bool = False,
|
1084
1084
|
*,
|
1085
|
-
dict_cls: None
|
1085
|
+
dict_cls: None,
|
1086
1086
|
) -> dict[str, Any]:
|
1087
1087
|
...
|
1088
1088
|
@overload
|
@@ -1091,7 +1091,7 @@ def normalize_attr_simple[D: dict[str, Any]](
|
|
1091
1091
|
/,
|
1092
1092
|
keep_raw: bool = False,
|
1093
1093
|
*,
|
1094
|
-
dict_cls: type[D],
|
1094
|
+
dict_cls: type[D] = AttrDict, # type: ignore
|
1095
1095
|
) -> D:
|
1096
1096
|
...
|
1097
1097
|
def normalize_attr_simple[D: dict[str, Any]](
|
@@ -1099,7 +1099,7 @@ def normalize_attr_simple[D: dict[str, Any]](
|
|
1099
1099
|
/,
|
1100
1100
|
keep_raw: bool = False,
|
1101
1101
|
*,
|
1102
|
-
dict_cls: None | type[D] =
|
1102
|
+
dict_cls: None | type[D] = AttrDict, # type: ignore
|
1103
1103
|
) -> dict[str, Any] | D:
|
1104
1104
|
return normalize_attr(
|
1105
1105
|
info,
|
@@ -1138,7 +1138,7 @@ class IgnoreCaseDict[V](dict[str, V]):
|
|
1138
1138
|
return cls(zip(map(str.lower, iterable), repeat(value)))
|
1139
1139
|
|
1140
1140
|
@overload
|
1141
|
-
def get(self, key: str) -> None | V:
|
1141
|
+
def get(self, key: str, default: None = None) -> None | V:
|
1142
1142
|
...
|
1143
1143
|
@overload
|
1144
1144
|
def get[T](self, key: str, default: T) -> V | T:
|
@@ -2329,7 +2329,7 @@ class ClientRequestMixin:
|
|
2329
2329
|
def login_with_app_id(
|
2330
2330
|
cls,
|
2331
2331
|
/,
|
2332
|
-
app_id: int | str
|
2332
|
+
app_id: int | str,
|
2333
2333
|
console_qrcode: bool = True,
|
2334
2334
|
base_url: str | Callable[[], str] = "https://qrcodeapi.115.com",
|
2335
2335
|
*,
|
@@ -2342,7 +2342,7 @@ class ClientRequestMixin:
|
|
2342
2342
|
def login_with_app_id(
|
2343
2343
|
cls,
|
2344
2344
|
/,
|
2345
|
-
app_id: int | str
|
2345
|
+
app_id: int | str,
|
2346
2346
|
console_qrcode: bool = True,
|
2347
2347
|
base_url: str | Callable[[], str] = "https://qrcodeapi.115.com",
|
2348
2348
|
*,
|
@@ -2354,7 +2354,7 @@ class ClientRequestMixin:
|
|
2354
2354
|
def login_with_app_id(
|
2355
2355
|
cls,
|
2356
2356
|
/,
|
2357
|
-
app_id: int | str
|
2357
|
+
app_id: int | str,
|
2358
2358
|
console_qrcode: bool = True,
|
2359
2359
|
base_url: str | Callable[[], str] = "https://qrcodeapi.115.com",
|
2360
2360
|
*,
|
@@ -4994,7 +4994,7 @@ class P115OpenClient(ClientRequestMixin):
|
|
4994
4994
|
else:
|
4995
4995
|
filesize, filesha1_obj = file_digest(file, "sha1")
|
4996
4996
|
finally:
|
4997
|
-
yield seek(curpos)
|
4997
|
+
yield cast(Callable, seek)(curpos)
|
4998
4998
|
filesha1 = filesha1_obj.hexdigest()
|
4999
4999
|
if filesize < 0:
|
5000
5000
|
try:
|
@@ -5006,9 +5006,9 @@ class P115OpenClient(ClientRequestMixin):
|
|
5006
5006
|
except TypeError:
|
5007
5007
|
if seekable:
|
5008
5008
|
try:
|
5009
|
-
filesize = (yield seek(0, 2)) - curpos
|
5009
|
+
filesize = (yield cast(Callable, seek)(0, 2)) - curpos
|
5010
5010
|
finally:
|
5011
|
-
yield seek(curpos)
|
5011
|
+
yield cast(Callable, seek)(curpos)
|
5012
5012
|
if filesize == 0:
|
5013
5013
|
filesha1 = "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709"
|
5014
5014
|
elif multipart_resume_data is None and filesize >= 1 << 20:
|
@@ -5018,13 +5018,13 @@ class P115OpenClient(ClientRequestMixin):
|
|
5018
5018
|
async_read = ensure_async(file.read, threaded=True)
|
5019
5019
|
async def read_range_bytes_or_hash(sign_check: str, /):
|
5020
5020
|
start, end = map(int, sign_check.split("-"))
|
5021
|
-
await seek(curpos + start)
|
5021
|
+
await cast(Callable, seek)(curpos + start)
|
5022
5022
|
return await async_read(end - start + 1)
|
5023
5023
|
else:
|
5024
5024
|
read = cast(Callable[[int], Buffer], file.read)
|
5025
5025
|
def read_range_bytes_or_hash(sign_check: str, /):
|
5026
5026
|
start, end = map(int, sign_check.split("-"))
|
5027
|
-
seek(curpos + start)
|
5027
|
+
cast(Callable, seek)(curpos + start)
|
5028
5028
|
return read(end - start + 1)
|
5029
5029
|
elif isinstance(file, (URL, SupportsGeturl)):
|
5030
5030
|
if isinstance(file, URL):
|
@@ -5194,6 +5194,60 @@ class P115OpenClient(ClientRequestMixin):
|
|
5194
5194
|
api = complete_proapi("/open/user/info", base_url)
|
5195
5195
|
return self.request(url=api, async_=async_, **request_kwargs)
|
5196
5196
|
|
5197
|
+
@overload
|
5198
|
+
def vip_qr_url(
|
5199
|
+
self,
|
5200
|
+
payload: int | dict,
|
5201
|
+
/,
|
5202
|
+
base_url: bool | str | Callable[[], str] = False,
|
5203
|
+
*,
|
5204
|
+
async_: Literal[False] = False,
|
5205
|
+
**request_kwargs,
|
5206
|
+
) -> dict:
|
5207
|
+
...
|
5208
|
+
@overload
|
5209
|
+
def vip_qr_url(
|
5210
|
+
self,
|
5211
|
+
payload: int | dict,
|
5212
|
+
/,
|
5213
|
+
base_url: bool | str | Callable[[], str] = False,
|
5214
|
+
*,
|
5215
|
+
async_: Literal[True],
|
5216
|
+
**request_kwargs,
|
5217
|
+
) -> Coroutine[Any, Any, dict]:
|
5218
|
+
...
|
5219
|
+
def vip_qr_url(
|
5220
|
+
self,
|
5221
|
+
payload: int | dict,
|
5222
|
+
/,
|
5223
|
+
base_url: bool | str | Callable[[], str] = False,
|
5224
|
+
*,
|
5225
|
+
async_: Literal[False, True] = False,
|
5226
|
+
**request_kwargs,
|
5227
|
+
) -> dict | Coroutine[Any, Any, dict]:
|
5228
|
+
"""获取产品列表地址(即引导用户扫码购买 115 的 VIP 服务,以获取提成)
|
5229
|
+
|
5230
|
+
GET https://proapi.115.com/open/open/vip/qr_url
|
5231
|
+
|
5232
|
+
.. admonition:: Reference
|
5233
|
+
|
5234
|
+
https://www.yuque.com/115yun/open/cguk6qshgapwg4qn#oByvI
|
5235
|
+
|
5236
|
+
:payload:
|
5237
|
+
- open_device: int
|
5238
|
+
- default_product_id: int = <default> 💡 打开产品列表默认选中的产品对应的产品id,如果没有则使用默认的产品顺序。
|
5239
|
+
|
5240
|
+
- 月费: 5
|
5241
|
+
- 年费: 1
|
5242
|
+
- 尝鲜1天: 101
|
5243
|
+
- 长期VIP(长期): 24072401
|
5244
|
+
- 超级VIP: 24072402
|
5245
|
+
"""
|
5246
|
+
api = complete_proapi("/open/vip/qr_url", base_url)
|
5247
|
+
if not isinstance(payload, dict):
|
5248
|
+
payload = {"open_device": payload}
|
5249
|
+
return self.request(url=api, params=payload, async_=async_, **request_kwargs)
|
5250
|
+
|
5197
5251
|
download_url_open = download_url
|
5198
5252
|
download_url_info_open = download_url_info
|
5199
5253
|
fs_copy_open = fs_copy
|
@@ -5226,6 +5280,7 @@ class P115OpenClient(ClientRequestMixin):
|
|
5226
5280
|
user_info_open = user_info
|
5227
5281
|
upload_file_init_open = upload_file_init
|
5228
5282
|
upload_file_open = upload_file
|
5283
|
+
vip_qr_url_open = vip_qr_url
|
5229
5284
|
|
5230
5285
|
|
5231
5286
|
class P115Client(P115OpenClient):
|
@@ -5902,7 +5957,7 @@ class P115Client(P115OpenClient):
|
|
5902
5957
|
def login_with_open(
|
5903
5958
|
self,
|
5904
5959
|
/,
|
5905
|
-
app_id: int | str
|
5960
|
+
app_id: int | str,
|
5906
5961
|
*,
|
5907
5962
|
show_warning: bool = False,
|
5908
5963
|
async_: Literal[False] = False,
|
@@ -5913,7 +5968,7 @@ class P115Client(P115OpenClient):
|
|
5913
5968
|
def login_with_open(
|
5914
5969
|
self,
|
5915
5970
|
/,
|
5916
|
-
app_id: int | str
|
5971
|
+
app_id: int | str,
|
5917
5972
|
*,
|
5918
5973
|
show_warning: bool = False,
|
5919
5974
|
async_: Literal[True],
|
@@ -5923,7 +5978,7 @@ class P115Client(P115OpenClient):
|
|
5923
5978
|
def login_with_open(
|
5924
5979
|
self,
|
5925
5980
|
/,
|
5926
|
-
app_id: int | str
|
5981
|
+
app_id: int | str,
|
5927
5982
|
*,
|
5928
5983
|
show_warning: bool = False,
|
5929
5984
|
async_: Literal[False, True] = False,
|
@@ -6098,7 +6153,7 @@ class P115Client(P115OpenClient):
|
|
6098
6153
|
def login_another_open(
|
6099
6154
|
self,
|
6100
6155
|
/,
|
6101
|
-
app_id: int | str
|
6156
|
+
app_id: int | str,
|
6102
6157
|
*,
|
6103
6158
|
replace: Literal[True] | Self,
|
6104
6159
|
show_warning: bool = False,
|
@@ -6110,7 +6165,7 @@ class P115Client(P115OpenClient):
|
|
6110
6165
|
def login_another_open(
|
6111
6166
|
self,
|
6112
6167
|
/,
|
6113
|
-
app_id: int | str
|
6168
|
+
app_id: int | str,
|
6114
6169
|
*,
|
6115
6170
|
replace: Literal[True] | Self,
|
6116
6171
|
show_warning: bool = False,
|
@@ -6122,7 +6177,7 @@ class P115Client(P115OpenClient):
|
|
6122
6177
|
def login_another_open(
|
6123
6178
|
self,
|
6124
6179
|
/,
|
6125
|
-
app_id: int | str
|
6180
|
+
app_id: int | str,
|
6126
6181
|
*,
|
6127
6182
|
replace: Literal[False] = False,
|
6128
6183
|
show_warning: bool = False,
|
@@ -6134,7 +6189,7 @@ class P115Client(P115OpenClient):
|
|
6134
6189
|
def login_another_open(
|
6135
6190
|
self,
|
6136
6191
|
/,
|
6137
|
-
app_id: int | str
|
6192
|
+
app_id: int | str,
|
6138
6193
|
*,
|
6139
6194
|
replace: Literal[False] = False,
|
6140
6195
|
show_warning: bool = False,
|
@@ -6145,7 +6200,7 @@ class P115Client(P115OpenClient):
|
|
6145
6200
|
def login_another_open(
|
6146
6201
|
self,
|
6147
6202
|
/,
|
6148
|
-
app_id: int | str
|
6203
|
+
app_id: int | str,
|
6149
6204
|
*,
|
6150
6205
|
replace: bool | Self = False,
|
6151
6206
|
show_warning: bool = False,
|
@@ -6540,7 +6595,7 @@ class P115Client(P115OpenClient):
|
|
6540
6595
|
continue
|
6541
6596
|
if i or is_auth_error:
|
6542
6597
|
raise
|
6543
|
-
app_id = getattr(self, "app_id"
|
6598
|
+
app_id = getattr(self, "app_id")
|
6544
6599
|
yield self.login_another_open(
|
6545
6600
|
app_id,
|
6546
6601
|
replace=True,
|
@@ -21125,7 +21180,7 @@ class P115Client(P115OpenClient):
|
|
21125
21180
|
else:
|
21126
21181
|
filesize, filesha1_obj = file_digest(file, "sha1")
|
21127
21182
|
finally:
|
21128
|
-
yield seek(curpos)
|
21183
|
+
yield cast(Callable, seek)(curpos)
|
21129
21184
|
filesha1 = filesha1_obj.hexdigest()
|
21130
21185
|
if filesize < 0:
|
21131
21186
|
try:
|
@@ -21137,9 +21192,9 @@ class P115Client(P115OpenClient):
|
|
21137
21192
|
except TypeError:
|
21138
21193
|
if seekable:
|
21139
21194
|
try:
|
21140
|
-
filesize = (yield seek(0, 2)) - curpos
|
21195
|
+
filesize = (yield cast(Callable, seek)(0, 2)) - curpos
|
21141
21196
|
finally:
|
21142
|
-
yield seek(curpos)
|
21197
|
+
yield cast(Callable, seek)(curpos)
|
21143
21198
|
if filesize == 0:
|
21144
21199
|
filesha1 = "DA39A3EE5E6B4B0D3255BFEF95601890AFD80709"
|
21145
21200
|
elif not upload_directly and multipart_resume_data is None and filesize >= 1 << 20:
|
@@ -21149,13 +21204,13 @@ class P115Client(P115OpenClient):
|
|
21149
21204
|
async_read = ensure_async(file.read, threaded=True)
|
21150
21205
|
async def read_range_bytes_or_hash(sign_check: str, /):
|
21151
21206
|
start, end = map(int, sign_check.split("-"))
|
21152
|
-
await seek(curpos + start)
|
21207
|
+
await cast(Callable, seek)(curpos + start)
|
21153
21208
|
return await async_read(end - start + 1)
|
21154
21209
|
else:
|
21155
21210
|
read = cast(Callable[[int], Buffer], file.read)
|
21156
21211
|
def read_range_bytes_or_hash(sign_check: str, /):
|
21157
21212
|
start, end = map(int, sign_check.split("-"))
|
21158
|
-
seek(curpos + start)
|
21213
|
+
cast(Callable, seek)(curpos + start)
|
21159
21214
|
return read(end - start + 1)
|
21160
21215
|
elif isinstance(file, (URL, SupportsGeturl)):
|
21161
21216
|
if isinstance(file, URL):
|
p115client/const.py
CHANGED
@@ -5,18 +5,14 @@ from __future__ import annotations
|
|
5
5
|
|
6
6
|
__author__ = "ChenyangGao <https://chenyanggao.github.io>"
|
7
7
|
__all__ = [
|
8
|
-
"
|
9
|
-
"
|
8
|
+
"AVAILABLE_APPS", "APP_TO_SSOENT", "SSOENT_TO_APP", "CLIENT_API_MAP",
|
9
|
+
"CLASS_TO_TYPE", "SUFFIX_TO_TYPE", "errno",
|
10
10
|
]
|
11
11
|
|
12
12
|
from enum import IntEnum
|
13
13
|
from typing import Final
|
14
14
|
|
15
15
|
|
16
|
-
#: 可用的 AppID 列表
|
17
|
-
AVAILABLE_APP_IDS = range(100195123, 100196845, 2)
|
18
|
-
|
19
|
-
|
20
16
|
#: 目前可用的登录设备
|
21
17
|
AVAILABLE_APPS: Final[tuple[str, ...]] = (
|
22
18
|
"web", "ios", "115ios", "android", "115android", "115ipad", "tv", "qandroid",
|
p115client/tool/attr.py
CHANGED
@@ -55,8 +55,8 @@ def get_attr(
|
|
55
55
|
if isinstance(client, str):
|
56
56
|
client = P115Client(client, check_for_relogin=True)
|
57
57
|
def gen_step():
|
58
|
+
from dictattr import AttrDict
|
58
59
|
if skim:
|
59
|
-
from dictattr import AttrDict
|
60
60
|
resp = yield client.fs_file_skim(id, async_=async_, **request_kwargs)
|
61
61
|
check_response(resp)
|
62
62
|
info = resp["data"][0]
|
@@ -71,7 +71,7 @@ def get_attr(
|
|
71
71
|
else:
|
72
72
|
resp = yield client.fs_file(id, async_=async_, **request_kwargs)
|
73
73
|
check_response(resp)
|
74
|
-
return normalize_attr_web(resp["data"][0])
|
74
|
+
return normalize_attr_web(resp["data"][0], dict_cls=AttrDict)
|
75
75
|
return run_gen_step(gen_step, may_call=False, async_=async_)
|
76
76
|
|
77
77
|
|
p115client/tool/download.py
CHANGED
@@ -10,7 +10,7 @@ __all__ = [
|
|
10
10
|
__doc__ = "这个模块提供了一些和下载有关的函数"
|
11
11
|
|
12
12
|
from asyncio import create_task, to_thread, Queue as AsyncQueue, TaskGroup
|
13
|
-
from collections.abc import AsyncIterator, Callable, Coroutine, Iterable, Iterator
|
13
|
+
from collections.abc import AsyncIterator, Callable, Coroutine, Iterable, Iterator, MutableMapping
|
14
14
|
from concurrent.futures import ThreadPoolExecutor
|
15
15
|
from errno import ENOTDIR
|
16
16
|
from functools import partial
|
@@ -243,7 +243,7 @@ def iter_files_with_url(
|
|
243
243
|
use_star: None | bool = False,
|
244
244
|
escape: None | bool | Callable[[str], str] = True,
|
245
245
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
246
|
-
id_to_dirnode: None | EllipsisType |
|
246
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
247
247
|
app: str = "web",
|
248
248
|
raise_for_changed_count: bool = False,
|
249
249
|
user_agent: str = "",
|
@@ -264,7 +264,7 @@ def iter_files_with_url(
|
|
264
264
|
use_star: None | bool = False,
|
265
265
|
escape: None | bool | Callable[[str], str] = True,
|
266
266
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
267
|
-
id_to_dirnode: None | EllipsisType |
|
267
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
268
268
|
app: str = "web",
|
269
269
|
raise_for_changed_count: bool = False,
|
270
270
|
user_agent: str = "",
|
@@ -284,7 +284,7 @@ def iter_files_with_url(
|
|
284
284
|
use_star: None | bool = False,
|
285
285
|
escape: None | bool | Callable[[str], str] = True,
|
286
286
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
287
|
-
id_to_dirnode: None | EllipsisType |
|
287
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
288
288
|
app: str = "web",
|
289
289
|
raise_for_changed_count: bool = False,
|
290
290
|
user_agent: str = "",
|
@@ -417,7 +417,7 @@ def iter_images_with_url(
|
|
417
417
|
use_star: None | bool = False,
|
418
418
|
escape: None | bool | Callable[[str], str] = True,
|
419
419
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
420
|
-
id_to_dirnode: None | EllipsisType |
|
420
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
421
421
|
app: str = "web",
|
422
422
|
raise_for_changed_count: bool = False,
|
423
423
|
*,
|
@@ -436,7 +436,7 @@ def iter_images_with_url(
|
|
436
436
|
use_star: None | bool = False,
|
437
437
|
escape: None | bool | Callable[[str], str] = True,
|
438
438
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
439
|
-
id_to_dirnode: None | EllipsisType |
|
439
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
440
440
|
app: str = "web",
|
441
441
|
raise_for_changed_count: bool = False,
|
442
442
|
*,
|
@@ -454,7 +454,7 @@ def iter_images_with_url(
|
|
454
454
|
use_star: None | bool = False,
|
455
455
|
escape: None | bool | Callable[[str], str] = True,
|
456
456
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
457
|
-
id_to_dirnode: None | EllipsisType |
|
457
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
458
458
|
app: str = "web",
|
459
459
|
raise_for_changed_count: bool = False,
|
460
460
|
*,
|
@@ -575,7 +575,7 @@ def iter_subtitles_with_url(
|
|
575
575
|
use_star: None | bool = False,
|
576
576
|
escape: None | bool | Callable[[str], str] = True,
|
577
577
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
578
|
-
id_to_dirnode: None | EllipsisType |
|
578
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
579
579
|
app: str = "web",
|
580
580
|
raise_for_changed_count: bool = False,
|
581
581
|
*,
|
@@ -594,7 +594,7 @@ def iter_subtitles_with_url(
|
|
594
594
|
use_star: None | bool = False,
|
595
595
|
escape: None | bool | Callable[[str], str] = True,
|
596
596
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
597
|
-
id_to_dirnode: None | EllipsisType |
|
597
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
598
598
|
app: str = "web",
|
599
599
|
raise_for_changed_count: bool = False,
|
600
600
|
*,
|
@@ -612,7 +612,7 @@ def iter_subtitles_with_url(
|
|
612
612
|
use_star: None | bool = False,
|
613
613
|
escape: None | bool | Callable[[str], str] = True,
|
614
614
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
615
|
-
id_to_dirnode: None | EllipsisType |
|
615
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
616
616
|
app: str = "web",
|
617
617
|
raise_for_changed_count: bool = False,
|
618
618
|
*,
|
@@ -855,7 +855,7 @@ def make_strm(
|
|
855
855
|
suffix: str = "",
|
856
856
|
type: Literal[1, 2, 3, 4, 5, 6, 7, 99] = 4,
|
857
857
|
max_workers: None | int = None,
|
858
|
-
id_to_dirnode: None | EllipsisType |
|
858
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
859
859
|
path_already: bool = False,
|
860
860
|
app: str = "android",
|
861
861
|
fs_files_cooldown: int | float = 0.5,
|
@@ -881,7 +881,7 @@ def make_strm(
|
|
881
881
|
suffix: str = "",
|
882
882
|
type: Literal[1, 2, 3, 4, 5, 6, 7, 99] = 4,
|
883
883
|
max_workers: None | int = None,
|
884
|
-
id_to_dirnode: None | EllipsisType |
|
884
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
885
885
|
path_already: bool = False,
|
886
886
|
app: str = "android",
|
887
887
|
fs_files_cooldown: int | float = 0.5,
|
@@ -906,7 +906,7 @@ def make_strm(
|
|
906
906
|
suffix: str = "",
|
907
907
|
type: Literal[1, 2, 3, 4, 5, 6, 7, 99] = 4,
|
908
908
|
max_workers: None | int = None,
|
909
|
-
id_to_dirnode: None | EllipsisType |
|
909
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
910
910
|
path_already: bool = False,
|
911
911
|
app: str = "android",
|
912
912
|
fs_files_cooldown: int | float = 0.5,
|
@@ -1295,7 +1295,7 @@ def iter_download_nodes(
|
|
1295
1295
|
def iter_download_files(
|
1296
1296
|
client: str | P115Client,
|
1297
1297
|
cid: int = 0,
|
1298
|
-
id_to_dirnode: None | EllipsisType |
|
1298
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1299
1299
|
escape: None | bool | Callable[[str], str] = True,
|
1300
1300
|
with_ancestors: bool = True,
|
1301
1301
|
max_workers: None | int = None,
|
@@ -1309,7 +1309,7 @@ def iter_download_files(
|
|
1309
1309
|
def iter_download_files(
|
1310
1310
|
client: str | P115Client,
|
1311
1311
|
cid: int = 0,
|
1312
|
-
id_to_dirnode: None | EllipsisType |
|
1312
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1313
1313
|
escape: None | bool | Callable[[str], str] = True,
|
1314
1314
|
with_ancestors: bool = True,
|
1315
1315
|
max_workers: None | int = None,
|
@@ -1322,7 +1322,7 @@ def iter_download_files(
|
|
1322
1322
|
def iter_download_files(
|
1323
1323
|
client: str | P115Client,
|
1324
1324
|
cid: int = 0,
|
1325
|
-
id_to_dirnode: None | EllipsisType |
|
1325
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1326
1326
|
escape: None | bool | Callable[[str], str] = True,
|
1327
1327
|
with_ancestors: bool = True,
|
1328
1328
|
max_workers: None | int = None,
|
p115client/tool/iterdir.py
CHANGED
@@ -21,7 +21,7 @@ from asyncio import create_task, sleep as async_sleep, Lock as AsyncLock
|
|
21
21
|
from collections import defaultdict
|
22
22
|
from collections.abc import (
|
23
23
|
AsyncIterable, AsyncIterator, Callable, Collection, Coroutine, Iterable, Iterator,
|
24
|
-
Mapping, Sequence,
|
24
|
+
Mapping, MutableMapping, Sequence,
|
25
25
|
)
|
26
26
|
from dataclasses import dataclass
|
27
27
|
from errno import EIO, ENOENT, ENOTDIR
|
@@ -129,7 +129,7 @@ def get_path_to_cid(
|
|
129
129
|
root_id: None | int = None,
|
130
130
|
escape: None | bool | Callable[[str], str] = True,
|
131
131
|
refresh: bool = False,
|
132
|
-
id_to_dirnode: None | EllipsisType |
|
132
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
133
133
|
app: str = "web",
|
134
134
|
*,
|
135
135
|
async_: Literal[False] = False,
|
@@ -143,7 +143,7 @@ def get_path_to_cid(
|
|
143
143
|
root_id: None | int = None,
|
144
144
|
escape: None | bool | Callable[[str], str] = True,
|
145
145
|
refresh: bool = False,
|
146
|
-
id_to_dirnode: None | EllipsisType |
|
146
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
147
147
|
app: str = "web",
|
148
148
|
*,
|
149
149
|
async_: Literal[True],
|
@@ -156,7 +156,7 @@ def get_path_to_cid(
|
|
156
156
|
root_id: None | int = None,
|
157
157
|
escape: None | bool | Callable[[str], str] = True,
|
158
158
|
refresh: bool = False,
|
159
|
-
id_to_dirnode: None | EllipsisType |
|
159
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
160
160
|
app: str = "web",
|
161
161
|
*,
|
162
162
|
async_: Literal[False, True] = False,
|
@@ -245,7 +245,7 @@ def get_path_to_cid(
|
|
245
245
|
def get_file_count(
|
246
246
|
client: str | P115Client,
|
247
247
|
cid: int = 0,
|
248
|
-
id_to_dirnode: None | EllipsisType |
|
248
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
249
249
|
app: str = "web",
|
250
250
|
use_fs_files: bool = True,
|
251
251
|
*,
|
@@ -257,7 +257,7 @@ def get_file_count(
|
|
257
257
|
def get_file_count(
|
258
258
|
client: str | P115Client,
|
259
259
|
cid: int = 0,
|
260
|
-
id_to_dirnode: None | EllipsisType |
|
260
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
261
261
|
app: str = "web",
|
262
262
|
use_fs_files: bool = True,
|
263
263
|
*,
|
@@ -268,7 +268,7 @@ def get_file_count(
|
|
268
268
|
def get_file_count(
|
269
269
|
client: str | P115Client,
|
270
270
|
cid: int = 0,
|
271
|
-
id_to_dirnode: None | EllipsisType |
|
271
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
272
272
|
app: str = "web",
|
273
273
|
use_fs_files: bool = True,
|
274
274
|
*,
|
@@ -377,7 +377,7 @@ def get_file_count(
|
|
377
377
|
def get_ancestors(
|
378
378
|
client: str | P115Client,
|
379
379
|
attr: int | dict,
|
380
|
-
id_to_dirnode: None | EllipsisType |
|
380
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
381
381
|
app: str = "web",
|
382
382
|
*,
|
383
383
|
async_: Literal[False] = False,
|
@@ -388,7 +388,7 @@ def get_ancestors(
|
|
388
388
|
def get_ancestors(
|
389
389
|
client: str | P115Client,
|
390
390
|
attr: int | dict,
|
391
|
-
id_to_dirnode: None | EllipsisType |
|
391
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
392
392
|
app: str = "web",
|
393
393
|
*,
|
394
394
|
async_: Literal[True],
|
@@ -398,7 +398,7 @@ def get_ancestors(
|
|
398
398
|
def get_ancestors(
|
399
399
|
client: str | P115Client,
|
400
400
|
attr: int | dict,
|
401
|
-
id_to_dirnode: None | EllipsisType |
|
401
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
402
402
|
app: str = "web",
|
403
403
|
*,
|
404
404
|
async_: Literal[False, True] = False,
|
@@ -598,7 +598,7 @@ def get_ancestors_to_cid(
|
|
598
598
|
client: str | P115Client,
|
599
599
|
cid: int = 0,
|
600
600
|
refresh: bool = False,
|
601
|
-
id_to_dirnode: None | EllipsisType |
|
601
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
602
602
|
app: str = "web",
|
603
603
|
*,
|
604
604
|
async_: Literal[False] = False,
|
@@ -610,7 +610,7 @@ def get_ancestors_to_cid(
|
|
610
610
|
client: str | P115Client,
|
611
611
|
cid: int = 0,
|
612
612
|
refresh: bool = False,
|
613
|
-
id_to_dirnode: None | EllipsisType |
|
613
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
614
614
|
app: str = "web",
|
615
615
|
*,
|
616
616
|
async_: Literal[True],
|
@@ -621,7 +621,7 @@ def get_ancestors_to_cid(
|
|
621
621
|
client: str | P115Client,
|
622
622
|
cid: int = 0,
|
623
623
|
refresh: bool = False,
|
624
|
-
id_to_dirnode: None | EllipsisType |
|
624
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
625
625
|
app: str = "web",
|
626
626
|
*,
|
627
627
|
async_: Literal[False, True] = False,
|
@@ -704,7 +704,7 @@ def get_id_to_path(
|
|
704
704
|
ensure_file: None | bool = None,
|
705
705
|
is_posixpath: bool = False,
|
706
706
|
refresh: bool = False,
|
707
|
-
id_to_dirnode: None | EllipsisType |
|
707
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
708
708
|
app: str = "web",
|
709
709
|
dont_use_getid: bool = False,
|
710
710
|
*,
|
@@ -720,7 +720,7 @@ def get_id_to_path(
|
|
720
720
|
ensure_file: None | bool = None,
|
721
721
|
is_posixpath: bool = False,
|
722
722
|
refresh: bool = False,
|
723
|
-
id_to_dirnode: None | EllipsisType |
|
723
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
724
724
|
app: str = "web",
|
725
725
|
dont_use_getid: bool = False,
|
726
726
|
*,
|
@@ -735,7 +735,7 @@ def get_id_to_path(
|
|
735
735
|
ensure_file: None | bool = None,
|
736
736
|
is_posixpath: bool = False,
|
737
737
|
refresh: bool = False,
|
738
|
-
id_to_dirnode: None | EllipsisType |
|
738
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
739
739
|
app: str = "web",
|
740
740
|
dont_use_getid: bool = False,
|
741
741
|
*,
|
@@ -1063,7 +1063,7 @@ def _iter_fs_files(
|
|
1063
1063
|
payload: int | str | dict = 0,
|
1064
1064
|
first_page_size: int = 0,
|
1065
1065
|
page_size: int = 0,
|
1066
|
-
id_to_dirnode: None | EllipsisType |
|
1066
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1067
1067
|
raise_for_changed_count: bool = False,
|
1068
1068
|
ensure_file: None | bool = None,
|
1069
1069
|
app: str = "web",
|
@@ -1080,7 +1080,7 @@ def _iter_fs_files(
|
|
1080
1080
|
payload: int | str | dict = 0,
|
1081
1081
|
first_page_size: int = 0,
|
1082
1082
|
page_size: int = 0,
|
1083
|
-
id_to_dirnode: None | EllipsisType |
|
1083
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1084
1084
|
raise_for_changed_count: bool = False,
|
1085
1085
|
ensure_file: None | bool = None,
|
1086
1086
|
app: str = "web",
|
@@ -1096,7 +1096,7 @@ def _iter_fs_files(
|
|
1096
1096
|
payload: int | str | dict = 0,
|
1097
1097
|
first_page_size: int = 0,
|
1098
1098
|
page_size: int = 0,
|
1099
|
-
id_to_dirnode: None | EllipsisType |
|
1099
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1100
1100
|
raise_for_changed_count: bool = False,
|
1101
1101
|
ensure_file: None | bool = None,
|
1102
1102
|
app: str = "web",
|
@@ -1213,7 +1213,7 @@ def iter_stared_dirs_raw(
|
|
1213
1213
|
first_page_size: int = 0,
|
1214
1214
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
1215
1215
|
asc: Literal[0, 1] = 1,
|
1216
|
-
id_to_dirnode: None | EllipsisType |
|
1216
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1217
1217
|
raise_for_changed_count: bool = False,
|
1218
1218
|
app: str = "web",
|
1219
1219
|
cooldown: int | float = 0,
|
@@ -1230,7 +1230,7 @@ def iter_stared_dirs_raw(
|
|
1230
1230
|
first_page_size: int = 0,
|
1231
1231
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
1232
1232
|
asc: Literal[0, 1] = 1,
|
1233
|
-
id_to_dirnode: None | EllipsisType |
|
1233
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1234
1234
|
raise_for_changed_count: bool = False,
|
1235
1235
|
app: str = "web",
|
1236
1236
|
cooldown: int | float = 0,
|
@@ -1246,7 +1246,7 @@ def iter_stared_dirs_raw(
|
|
1246
1246
|
first_page_size: int = 0,
|
1247
1247
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
1248
1248
|
asc: Literal[0, 1] = 1,
|
1249
|
-
id_to_dirnode: None | EllipsisType |
|
1249
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1250
1250
|
raise_for_changed_count: bool = False,
|
1251
1251
|
app: str = "web",
|
1252
1252
|
cooldown: int | float = 0,
|
@@ -1307,7 +1307,7 @@ def iter_stared_dirs(
|
|
1307
1307
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
1308
1308
|
asc: Literal[0, 1] = 1,
|
1309
1309
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
1310
|
-
id_to_dirnode: None | EllipsisType |
|
1310
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1311
1311
|
raise_for_changed_count: bool = False,
|
1312
1312
|
app: str = "web",
|
1313
1313
|
cooldown: int | float = 0,
|
@@ -1325,7 +1325,7 @@ def iter_stared_dirs(
|
|
1325
1325
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
1326
1326
|
asc: Literal[0, 1] = 1,
|
1327
1327
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
1328
|
-
id_to_dirnode: None | EllipsisType |
|
1328
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1329
1329
|
raise_for_changed_count: bool = False,
|
1330
1330
|
app: str = "web",
|
1331
1331
|
cooldown: int | float = 0,
|
@@ -1342,7 +1342,7 @@ def iter_stared_dirs(
|
|
1342
1342
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
1343
1343
|
asc: Literal[0, 1] = 1,
|
1344
1344
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
1345
|
-
id_to_dirnode: None | EllipsisType |
|
1345
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1346
1346
|
raise_for_changed_count: bool = False,
|
1347
1347
|
app: str = "web",
|
1348
1348
|
cooldown: int | float = 0,
|
@@ -1404,7 +1404,7 @@ def ensure_attr_path[D: dict](
|
|
1404
1404
|
use_star: bool = False,
|
1405
1405
|
life_event_cooldown: int | float = 0.5,
|
1406
1406
|
escape: None | bool | Callable[[str], str] = True,
|
1407
|
-
id_to_dirnode: None | EllipsisType |
|
1407
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1408
1408
|
make_up_missing: bool = True,
|
1409
1409
|
app: str = "web",
|
1410
1410
|
errors: Literal["ignore", "raise", "warn"] = "raise",
|
@@ -1423,7 +1423,7 @@ def ensure_attr_path[D: dict](
|
|
1423
1423
|
use_star: bool = False,
|
1424
1424
|
life_event_cooldown: int | float = 0.5,
|
1425
1425
|
escape: None | bool | Callable[[str], str] = True,
|
1426
|
-
id_to_dirnode: None | EllipsisType |
|
1426
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1427
1427
|
make_up_missing: bool = True,
|
1428
1428
|
app: str = "web",
|
1429
1429
|
errors: Literal["ignore", "raise", "warn"] = "raise",
|
@@ -1441,7 +1441,7 @@ def ensure_attr_path[D: dict](
|
|
1441
1441
|
use_star: bool = False,
|
1442
1442
|
life_event_cooldown: int | float = 0.5,
|
1443
1443
|
escape: None | bool | Callable[[str], str] = True,
|
1444
|
-
id_to_dirnode: None | EllipsisType |
|
1444
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1445
1445
|
make_up_missing: bool = True,
|
1446
1446
|
app: str = "web",
|
1447
1447
|
errors: Literal["ignore", "raise", "warn"] = "raise",
|
@@ -1603,7 +1603,7 @@ def ensure_attr_path_by_category_get[D: dict](
|
|
1603
1603
|
with_ancestors: bool = False,
|
1604
1604
|
with_path: bool = True,
|
1605
1605
|
escape: None | bool | Callable[[str], str] = True,
|
1606
|
-
id_to_dirnode: None | EllipsisType |
|
1606
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1607
1607
|
app: str = "web",
|
1608
1608
|
max_workers: None | int = 20,
|
1609
1609
|
*,
|
@@ -1618,7 +1618,7 @@ def ensure_attr_path_by_category_get[D: dict](
|
|
1618
1618
|
with_ancestors: bool = False,
|
1619
1619
|
with_path: bool = True,
|
1620
1620
|
escape: None | bool | Callable[[str], str] = True,
|
1621
|
-
id_to_dirnode: None | EllipsisType |
|
1621
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1622
1622
|
app: str = "web",
|
1623
1623
|
max_workers: None | int = 20,
|
1624
1624
|
*,
|
@@ -1632,7 +1632,7 @@ def ensure_attr_path_by_category_get[D: dict](
|
|
1632
1632
|
with_ancestors: bool = False,
|
1633
1633
|
with_path: bool = True,
|
1634
1634
|
escape: None | bool | Callable[[str], str] = True,
|
1635
|
-
id_to_dirnode: None | EllipsisType |
|
1635
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1636
1636
|
app: str = "web",
|
1637
1637
|
max_workers: None | int = 20,
|
1638
1638
|
*,
|
@@ -1789,7 +1789,7 @@ def iterdir_raw(
|
|
1789
1789
|
asc: Literal[0, 1] = 1,
|
1790
1790
|
show_dir: Literal[0, 1] = 1,
|
1791
1791
|
fc_mix: Literal[0, 1] = 1,
|
1792
|
-
id_to_dirnode: None | EllipsisType |
|
1792
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1793
1793
|
raise_for_changed_count: bool = False,
|
1794
1794
|
ensure_file: None | bool = None,
|
1795
1795
|
app: str = "web",
|
@@ -1810,7 +1810,7 @@ def iterdir_raw(
|
|
1810
1810
|
asc: Literal[0, 1] = 1,
|
1811
1811
|
show_dir: Literal[0, 1] = 1,
|
1812
1812
|
fc_mix: Literal[0, 1] = 1,
|
1813
|
-
id_to_dirnode: None | EllipsisType |
|
1813
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1814
1814
|
raise_for_changed_count: bool = False,
|
1815
1815
|
ensure_file: None | bool = None,
|
1816
1816
|
app: str = "web",
|
@@ -1830,7 +1830,7 @@ def iterdir_raw(
|
|
1830
1830
|
asc: Literal[0, 1] = 1,
|
1831
1831
|
show_dir: Literal[0, 1] = 1,
|
1832
1832
|
fc_mix: Literal[0, 1] = 1,
|
1833
|
-
id_to_dirnode: None | EllipsisType |
|
1833
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1834
1834
|
raise_for_changed_count: bool = False,
|
1835
1835
|
ensure_file: None | bool = None,
|
1836
1836
|
app: str = "web",
|
@@ -1907,7 +1907,7 @@ def iterdir(
|
|
1907
1907
|
with_path: bool = False,
|
1908
1908
|
escape: None | bool | Callable[[str], str] = True,
|
1909
1909
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
1910
|
-
id_to_dirnode: None | EllipsisType |
|
1910
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1911
1911
|
raise_for_changed_count: bool = False,
|
1912
1912
|
ensure_file: None | bool = None,
|
1913
1913
|
app: str = "web",
|
@@ -1932,7 +1932,7 @@ def iterdir(
|
|
1932
1932
|
with_path: bool = False,
|
1933
1933
|
escape: None | bool | Callable[[str], str] = True,
|
1934
1934
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
1935
|
-
id_to_dirnode: None | EllipsisType |
|
1935
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1936
1936
|
raise_for_changed_count: bool = False,
|
1937
1937
|
ensure_file: None | bool = None,
|
1938
1938
|
app: str = "web",
|
@@ -1956,7 +1956,7 @@ def iterdir(
|
|
1956
1956
|
with_path: bool = False,
|
1957
1957
|
escape: None | bool | Callable[[str], str] = True,
|
1958
1958
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
1959
|
-
id_to_dirnode: None | EllipsisType |
|
1959
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
1960
1960
|
raise_for_changed_count: bool = False,
|
1961
1961
|
ensure_file: None | bool = None,
|
1962
1962
|
app: str = "web",
|
@@ -2088,7 +2088,7 @@ def iterdir_limited(
|
|
2088
2088
|
with_path: bool = False,
|
2089
2089
|
escape: None | bool | Callable[[str], str] = True,
|
2090
2090
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2091
|
-
id_to_dirnode: None | EllipsisType |
|
2091
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2092
2092
|
ensure_file: None | bool = None,
|
2093
2093
|
*,
|
2094
2094
|
async_: Literal[False, True] = False,
|
@@ -2253,7 +2253,7 @@ def iter_files_raw(
|
|
2253
2253
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
2254
2254
|
asc: Literal[0, 1] = 1,
|
2255
2255
|
cur: Literal[0, 1] = 0,
|
2256
|
-
id_to_dirnode: None | EllipsisType |
|
2256
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2257
2257
|
raise_for_changed_count: bool = False,
|
2258
2258
|
app: str = "web",
|
2259
2259
|
cooldown: int | float = 0,
|
@@ -2274,7 +2274,7 @@ def iter_files_raw(
|
|
2274
2274
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
2275
2275
|
asc: Literal[0, 1] = 1,
|
2276
2276
|
cur: Literal[0, 1] = 0,
|
2277
|
-
id_to_dirnode: None | EllipsisType |
|
2277
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2278
2278
|
raise_for_changed_count: bool = False,
|
2279
2279
|
app: str = "web",
|
2280
2280
|
cooldown: int | float = 0,
|
@@ -2294,7 +2294,7 @@ def iter_files_raw(
|
|
2294
2294
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
2295
2295
|
asc: Literal[0, 1] = 1,
|
2296
2296
|
cur: Literal[0, 1] = 0,
|
2297
|
-
id_to_dirnode: None | EllipsisType |
|
2297
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2298
2298
|
raise_for_changed_count: bool = False,
|
2299
2299
|
app: str = "web",
|
2300
2300
|
cooldown: int | float = 0,
|
@@ -2385,7 +2385,7 @@ def iter_files(
|
|
2385
2385
|
use_star: None | bool = False,
|
2386
2386
|
escape: None | bool | Callable[[str], str] = True,
|
2387
2387
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2388
|
-
id_to_dirnode: None | EllipsisType |
|
2388
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2389
2389
|
raise_for_changed_count: bool = False,
|
2390
2390
|
app: str = "web",
|
2391
2391
|
cooldown: int | float = 0,
|
@@ -2411,7 +2411,7 @@ def iter_files(
|
|
2411
2411
|
use_star: None | bool = False,
|
2412
2412
|
escape: None | bool | Callable[[str], str] = True,
|
2413
2413
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2414
|
-
id_to_dirnode: None | EllipsisType |
|
2414
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2415
2415
|
raise_for_changed_count: bool = False,
|
2416
2416
|
app: str = "web",
|
2417
2417
|
cooldown: int | float = 0,
|
@@ -2436,7 +2436,7 @@ def iter_files(
|
|
2436
2436
|
use_star: None | bool = False,
|
2437
2437
|
escape: None | bool | Callable[[str], str] = True,
|
2438
2438
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2439
|
-
id_to_dirnode: None | EllipsisType |
|
2439
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2440
2440
|
raise_for_changed_count: bool = False,
|
2441
2441
|
app: str = "web",
|
2442
2442
|
cooldown: int | float = 0,
|
@@ -2626,7 +2626,7 @@ def traverse_files(
|
|
2626
2626
|
with_path: bool = False,
|
2627
2627
|
escape: None | bool | Callable[[str], str] = True,
|
2628
2628
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2629
|
-
id_to_dirnode: None | EllipsisType |
|
2629
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2630
2630
|
raise_for_changed_count: bool = False,
|
2631
2631
|
app: str = "web",
|
2632
2632
|
cooldown: int | float = 0,
|
@@ -2650,7 +2650,7 @@ def traverse_files(
|
|
2650
2650
|
with_path: bool = False,
|
2651
2651
|
escape: None | bool | Callable[[str], str] = True,
|
2652
2652
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2653
|
-
id_to_dirnode: None | EllipsisType |
|
2653
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2654
2654
|
raise_for_changed_count: bool = False,
|
2655
2655
|
app: str = "web",
|
2656
2656
|
cooldown: int | float = 0,
|
@@ -2673,7 +2673,7 @@ def traverse_files(
|
|
2673
2673
|
with_path: bool = False,
|
2674
2674
|
escape: None | bool | Callable[[str], str] = True,
|
2675
2675
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2676
|
-
id_to_dirnode: None | EllipsisType |
|
2676
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2677
2677
|
raise_for_changed_count: bool = False,
|
2678
2678
|
app: str = "web",
|
2679
2679
|
cooldown: int | float = 0,
|
@@ -2821,7 +2821,7 @@ def traverse_files(
|
|
2821
2821
|
def iter_dirs(
|
2822
2822
|
client: str | P115Client,
|
2823
2823
|
cid: int | str = 0,
|
2824
|
-
id_to_dirnode: None | EllipsisType |
|
2824
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2825
2825
|
with_pickcode: bool = False,
|
2826
2826
|
max_workers: None | int = None,
|
2827
2827
|
*,
|
@@ -2833,7 +2833,7 @@ def iter_dirs(
|
|
2833
2833
|
def iter_dirs(
|
2834
2834
|
client: str | P115Client,
|
2835
2835
|
cid: int | str = 0,
|
2836
|
-
id_to_dirnode: None | EllipsisType |
|
2836
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2837
2837
|
with_pickcode: bool = False,
|
2838
2838
|
max_workers: None | int = None,
|
2839
2839
|
*,
|
@@ -2844,7 +2844,7 @@ def iter_dirs(
|
|
2844
2844
|
def iter_dirs(
|
2845
2845
|
client: str | P115Client,
|
2846
2846
|
cid: int | str = 0,
|
2847
|
-
id_to_dirnode: None | EllipsisType |
|
2847
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2848
2848
|
with_pickcode: bool = False,
|
2849
2849
|
max_workers: None | int = None,
|
2850
2850
|
*,
|
@@ -2928,7 +2928,7 @@ def iter_dupfiles[K](
|
|
2928
2928
|
with_path: bool = False,
|
2929
2929
|
escape: None | bool | Callable[[str], str] = True,
|
2930
2930
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2931
|
-
id_to_dirnode: None | EllipsisType |
|
2931
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2932
2932
|
raise_for_changed_count: bool = False,
|
2933
2933
|
app: str = "web",
|
2934
2934
|
cooldown: int | float = 0,
|
@@ -2953,7 +2953,7 @@ def iter_dupfiles[K](
|
|
2953
2953
|
with_path: bool = False,
|
2954
2954
|
escape: None | bool | Callable[[str], str] = True,
|
2955
2955
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2956
|
-
id_to_dirnode: None | EllipsisType |
|
2956
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2957
2957
|
raise_for_changed_count: bool = False,
|
2958
2958
|
app: str = "web",
|
2959
2959
|
cooldown: int | float = 0,
|
@@ -2977,7 +2977,7 @@ def iter_dupfiles[K](
|
|
2977
2977
|
with_path: bool = False,
|
2978
2978
|
escape: None | bool | Callable[[str], str] = True,
|
2979
2979
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
2980
|
-
id_to_dirnode: None | EllipsisType |
|
2980
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
2981
2981
|
raise_for_changed_count: bool = False,
|
2982
2982
|
app: str = "web",
|
2983
2983
|
cooldown: int | float = 0,
|
@@ -3173,7 +3173,7 @@ def share_iterdir(
|
|
3173
3173
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
3174
3174
|
asc: Literal[0, 1] = 1,
|
3175
3175
|
normalize_attr: None | Callable[[dict], dict] = normalize_attr,
|
3176
|
-
id_to_dirnode: None | EllipsisType |
|
3176
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3177
3177
|
*,
|
3178
3178
|
async_: Literal[False] = False,
|
3179
3179
|
**request_kwargs,
|
@@ -3189,7 +3189,7 @@ def share_iterdir(
|
|
3189
3189
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
3190
3190
|
asc: Literal[0, 1] = 1,
|
3191
3191
|
normalize_attr: None | Callable[[dict], dict] = normalize_attr,
|
3192
|
-
id_to_dirnode: None | EllipsisType |
|
3192
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3193
3193
|
*,
|
3194
3194
|
async_: Literal[True],
|
3195
3195
|
**request_kwargs,
|
@@ -3204,7 +3204,7 @@ def share_iterdir(
|
|
3204
3204
|
order: Literal["file_name", "file_size", "file_type", "user_utime", "user_ptime", "user_otime"] = "user_ptime",
|
3205
3205
|
asc: Literal[0, 1] = 1,
|
3206
3206
|
normalize_attr: None | Callable[[dict], dict] = normalize_attr,
|
3207
|
-
id_to_dirnode: None | EllipsisType |
|
3207
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3208
3208
|
*,
|
3209
3209
|
async_: Literal[False, True] = False,
|
3210
3210
|
**request_kwargs,
|
@@ -3281,7 +3281,7 @@ def share_iter_files(
|
|
3281
3281
|
client: str | P115Client,
|
3282
3282
|
share_link: str,
|
3283
3283
|
receive_code: str = "",
|
3284
|
-
id_to_dirnode: None | EllipsisType |
|
3284
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3285
3285
|
*,
|
3286
3286
|
async_: Literal[False] = False,
|
3287
3287
|
**request_kwargs,
|
@@ -3292,7 +3292,7 @@ def share_iter_files(
|
|
3292
3292
|
client: str | P115Client,
|
3293
3293
|
share_link: str,
|
3294
3294
|
receive_code: str = "",
|
3295
|
-
id_to_dirnode: None | EllipsisType |
|
3295
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3296
3296
|
*,
|
3297
3297
|
async_: Literal[True],
|
3298
3298
|
**request_kwargs,
|
@@ -3302,7 +3302,7 @@ def share_iter_files(
|
|
3302
3302
|
client: str | P115Client,
|
3303
3303
|
share_link: str,
|
3304
3304
|
receive_code: str = "",
|
3305
|
-
id_to_dirnode: None | EllipsisType |
|
3305
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3306
3306
|
*,
|
3307
3307
|
async_: Literal[False, True] = False,
|
3308
3308
|
**request_kwargs,
|
@@ -3389,7 +3389,7 @@ def share_get_id_to_path(
|
|
3389
3389
|
ensure_file: None | bool = None,
|
3390
3390
|
is_posixpath: bool = False,
|
3391
3391
|
refresh: bool = False,
|
3392
|
-
id_to_dirnode: None | EllipsisType |
|
3392
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3393
3393
|
*,
|
3394
3394
|
async_: Literal[False] = False,
|
3395
3395
|
**request_kwargs,
|
@@ -3405,7 +3405,7 @@ def share_get_id_to_path(
|
|
3405
3405
|
ensure_file: None | bool = None,
|
3406
3406
|
is_posixpath: bool = False,
|
3407
3407
|
refresh: bool = False,
|
3408
|
-
id_to_dirnode: None | EllipsisType |
|
3408
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3409
3409
|
*,
|
3410
3410
|
async_: Literal[True],
|
3411
3411
|
**request_kwargs,
|
@@ -3420,7 +3420,7 @@ def share_get_id_to_path(
|
|
3420
3420
|
ensure_file: None | bool = None,
|
3421
3421
|
is_posixpath: bool = False,
|
3422
3422
|
refresh: bool = False,
|
3423
|
-
id_to_dirnode: None | EllipsisType |
|
3423
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3424
3424
|
*,
|
3425
3425
|
async_: Literal[False, True] = False,
|
3426
3426
|
**request_kwargs,
|
@@ -3555,7 +3555,7 @@ def iter_selected_nodes(
|
|
3555
3555
|
ids: Iterable[int],
|
3556
3556
|
ignore_deleted: bool = True,
|
3557
3557
|
normalize_attr: None | Callable[[dict], dict] = normalize_attr,
|
3558
|
-
id_to_dirnode: None | EllipsisType |
|
3558
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3559
3559
|
max_workers: None | int = 20,
|
3560
3560
|
*,
|
3561
3561
|
async_: Literal[False] = False,
|
@@ -3568,7 +3568,7 @@ def iter_selected_nodes(
|
|
3568
3568
|
ids: Iterable[int],
|
3569
3569
|
ignore_deleted: bool = True,
|
3570
3570
|
normalize_attr: None | Callable[[dict], dict] = normalize_attr,
|
3571
|
-
id_to_dirnode: None | EllipsisType |
|
3571
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3572
3572
|
max_workers: None | int = 20,
|
3573
3573
|
*,
|
3574
3574
|
async_: Literal[True],
|
@@ -3580,7 +3580,7 @@ def iter_selected_nodes(
|
|
3580
3580
|
ids: Iterable[int],
|
3581
3581
|
ignore_deleted: bool = True,
|
3582
3582
|
normalize_attr: None | Callable[[dict], dict] = normalize_attr,
|
3583
|
-
id_to_dirnode: None | EllipsisType |
|
3583
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3584
3584
|
max_workers: None | int = 20,
|
3585
3585
|
*,
|
3586
3586
|
async_: Literal[False, True] = False,
|
@@ -3652,7 +3652,7 @@ def iter_selected_nodes_by_pickcode(
|
|
3652
3652
|
ids: Iterable[int | str],
|
3653
3653
|
ignore_deleted: None | bool = True,
|
3654
3654
|
normalize_attr: None | Callable[[dict], dict] = None,
|
3655
|
-
id_to_dirnode: None | EllipsisType |
|
3655
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3656
3656
|
max_workers: None | int = 20,
|
3657
3657
|
*,
|
3658
3658
|
async_: Literal[False] = False,
|
@@ -3665,7 +3665,7 @@ def iter_selected_nodes_by_pickcode(
|
|
3665
3665
|
ids: Iterable[int | str],
|
3666
3666
|
ignore_deleted: None | bool = True,
|
3667
3667
|
normalize_attr: None | Callable[[dict], dict] = None,
|
3668
|
-
id_to_dirnode: None | EllipsisType |
|
3668
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3669
3669
|
max_workers: None | int = 20,
|
3670
3670
|
*,
|
3671
3671
|
async_: Literal[True],
|
@@ -3677,7 +3677,7 @@ def iter_selected_nodes_by_pickcode(
|
|
3677
3677
|
ids: Iterable[int | str],
|
3678
3678
|
ignore_deleted: None | bool = True,
|
3679
3679
|
normalize_attr: None | Callable[[dict], dict] = None,
|
3680
|
-
id_to_dirnode: None | EllipsisType |
|
3680
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3681
3681
|
max_workers: None | int = 20,
|
3682
3682
|
*,
|
3683
3683
|
async_: Literal[False, True] = False,
|
@@ -3765,7 +3765,7 @@ def iter_selected_nodes_by_pickcode(
|
|
3765
3765
|
def iter_selected_nodes_using_edit(
|
3766
3766
|
client: str | P115Client,
|
3767
3767
|
ids: Iterable[int],
|
3768
|
-
id_to_dirnode: None | EllipsisType |
|
3768
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3769
3769
|
max_workers: None | int = 20,
|
3770
3770
|
*,
|
3771
3771
|
async_: Literal[False] = False,
|
@@ -3776,7 +3776,7 @@ def iter_selected_nodes_using_edit(
|
|
3776
3776
|
def iter_selected_nodes_using_edit(
|
3777
3777
|
client: str | P115Client,
|
3778
3778
|
ids: Iterable[int],
|
3779
|
-
id_to_dirnode: None | EllipsisType |
|
3779
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3780
3780
|
max_workers: None | int = 20,
|
3781
3781
|
*,
|
3782
3782
|
async_: Literal[True],
|
@@ -3786,7 +3786,7 @@ def iter_selected_nodes_using_edit(
|
|
3786
3786
|
def iter_selected_nodes_using_edit(
|
3787
3787
|
client: str | P115Client,
|
3788
3788
|
ids: Iterable[int],
|
3789
|
-
id_to_dirnode: None | EllipsisType |
|
3789
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3790
3790
|
max_workers: None | int = 20,
|
3791
3791
|
*,
|
3792
3792
|
async_: Literal[False, True] = False,
|
@@ -3852,7 +3852,7 @@ def iter_selected_nodes_using_edit(
|
|
3852
3852
|
def iter_selected_nodes_using_category_get(
|
3853
3853
|
client: str | P115Client,
|
3854
3854
|
ids: Iterable[int],
|
3855
|
-
id_to_dirnode: None | EllipsisType |
|
3855
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3856
3856
|
max_workers: None | int = 20,
|
3857
3857
|
*,
|
3858
3858
|
async_: Literal[False] = False,
|
@@ -3863,7 +3863,7 @@ def iter_selected_nodes_using_category_get(
|
|
3863
3863
|
def iter_selected_nodes_using_category_get(
|
3864
3864
|
client: str | P115Client,
|
3865
3865
|
ids: Iterable[int],
|
3866
|
-
id_to_dirnode: None | EllipsisType |
|
3866
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3867
3867
|
max_workers: None | int = 20,
|
3868
3868
|
*,
|
3869
3869
|
async_: Literal[True],
|
@@ -3873,7 +3873,7 @@ def iter_selected_nodes_using_category_get(
|
|
3873
3873
|
def iter_selected_nodes_using_category_get(
|
3874
3874
|
client: str | P115Client,
|
3875
3875
|
ids: Iterable[int],
|
3876
|
-
id_to_dirnode: None | EllipsisType |
|
3876
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3877
3877
|
max_workers: None | int = 20,
|
3878
3878
|
*,
|
3879
3879
|
async_: Literal[False, True] = False,
|
@@ -3940,7 +3940,7 @@ def iter_selected_nodes_using_star_event(
|
|
3940
3940
|
ids: Iterable[int],
|
3941
3941
|
with_pics: bool = False,
|
3942
3942
|
normalize_attr: None | bool | Callable[[dict], dict] = True,
|
3943
|
-
id_to_dirnode: None | EllipsisType |
|
3943
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3944
3944
|
app: str = "web",
|
3945
3945
|
cooldown: int | float = 0,
|
3946
3946
|
*,
|
@@ -3954,7 +3954,7 @@ def iter_selected_nodes_using_star_event(
|
|
3954
3954
|
ids: Iterable[int],
|
3955
3955
|
with_pics: bool = False,
|
3956
3956
|
normalize_attr: None | bool | Callable[[dict], dict] = True,
|
3957
|
-
id_to_dirnode: None | EllipsisType |
|
3957
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3958
3958
|
app: str = "web",
|
3959
3959
|
cooldown: int | float = 0,
|
3960
3960
|
*,
|
@@ -3967,7 +3967,7 @@ def iter_selected_nodes_using_star_event(
|
|
3967
3967
|
ids: Iterable[int],
|
3968
3968
|
with_pics: bool = False,
|
3969
3969
|
normalize_attr: None | bool | Callable[[dict], dict] = True,
|
3970
|
-
id_to_dirnode: None | EllipsisType |
|
3970
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
3971
3971
|
app: str = "web",
|
3972
3972
|
cooldown: int | float = 0,
|
3973
3973
|
*,
|
@@ -4095,7 +4095,7 @@ def iter_selected_nodes_using_star_event(
|
|
4095
4095
|
def iter_selected_dirs_using_star(
|
4096
4096
|
client: str | P115Client,
|
4097
4097
|
ids: Iterable[int],
|
4098
|
-
id_to_dirnode: None | EllipsisType |
|
4098
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
4099
4099
|
raise_for_changed_count: bool = False,
|
4100
4100
|
app: str = "web",
|
4101
4101
|
cooldown: int | float = 0,
|
@@ -4109,7 +4109,7 @@ def iter_selected_dirs_using_star(
|
|
4109
4109
|
def iter_selected_dirs_using_star(
|
4110
4110
|
client: str | P115Client,
|
4111
4111
|
ids: Iterable[int],
|
4112
|
-
id_to_dirnode: None | EllipsisType |
|
4112
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
4113
4113
|
raise_for_changed_count: bool = False,
|
4114
4114
|
app: str = "web",
|
4115
4115
|
cooldown: int | float = 0,
|
@@ -4122,7 +4122,7 @@ def iter_selected_dirs_using_star(
|
|
4122
4122
|
def iter_selected_dirs_using_star(
|
4123
4123
|
client: str | P115Client,
|
4124
4124
|
ids: Iterable[int],
|
4125
|
-
id_to_dirnode: None | EllipsisType |
|
4125
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
4126
4126
|
raise_for_changed_count: bool = False,
|
4127
4127
|
app: str = "web",
|
4128
4128
|
cooldown: int | float = 0,
|
@@ -4393,7 +4393,7 @@ def iter_files_with_path(
|
|
4393
4393
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
4394
4394
|
escape: None | bool | Callable[[str], str] = True,
|
4395
4395
|
with_ancestors: bool = True,
|
4396
|
-
id_to_dirnode: None | EllipsisType |
|
4396
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
4397
4397
|
path_already: bool = False,
|
4398
4398
|
raise_for_changed_count: bool = False,
|
4399
4399
|
app: str = "android",
|
@@ -4417,7 +4417,7 @@ def iter_files_with_path(
|
|
4417
4417
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
4418
4418
|
escape: None | bool | Callable[[str], str] = True,
|
4419
4419
|
with_ancestors: bool = True,
|
4420
|
-
id_to_dirnode: None | EllipsisType |
|
4420
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
4421
4421
|
path_already: bool = False,
|
4422
4422
|
raise_for_changed_count: bool = False,
|
4423
4423
|
app: str = "android",
|
@@ -4440,7 +4440,7 @@ def iter_files_with_path(
|
|
4440
4440
|
normalize_attr: Callable[[dict], dict] = normalize_attr,
|
4441
4441
|
escape: None | bool | Callable[[str], str] = True,
|
4442
4442
|
with_ancestors: bool = True,
|
4443
|
-
id_to_dirnode: None | EllipsisType |
|
4443
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
4444
4444
|
path_already: bool = False,
|
4445
4445
|
raise_for_changed_count: bool = False,
|
4446
4446
|
app: str = "android",
|
@@ -5001,7 +5001,7 @@ def iter_parents_3_level(
|
|
5001
5001
|
def iter_dir_nodes(
|
5002
5002
|
client: str | P115Client,
|
5003
5003
|
cid: int | str = 0,
|
5004
|
-
id_to_dirnode: None | EllipsisType |
|
5004
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
5005
5005
|
max_workers: None | int = None,
|
5006
5006
|
*,
|
5007
5007
|
async_: Literal[False] = False,
|
@@ -5012,7 +5012,7 @@ def iter_dir_nodes(
|
|
5012
5012
|
def iter_dir_nodes(
|
5013
5013
|
client: str | P115Client,
|
5014
5014
|
cid: int | str = 0,
|
5015
|
-
id_to_dirnode: None | EllipsisType |
|
5015
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
5016
5016
|
max_workers: None | int = None,
|
5017
5017
|
*,
|
5018
5018
|
async_: Literal[True],
|
@@ -5022,7 +5022,7 @@ def iter_dir_nodes(
|
|
5022
5022
|
def iter_dir_nodes(
|
5023
5023
|
client: str | P115Client,
|
5024
5024
|
cid: int | str = 0,
|
5025
|
-
id_to_dirnode: None | EllipsisType |
|
5025
|
+
id_to_dirnode: None | EllipsisType | MutableMapping[int, tuple[str, int] | DirNode] = None,
|
5026
5026
|
max_workers: None | int = None,
|
5027
5027
|
*,
|
5028
5028
|
async_: Literal[False, True] = False,
|
p115client/tool/pool.py
CHANGED
@@ -21,7 +21,6 @@ from time import time
|
|
21
21
|
|
22
22
|
from iterutils import run_gen_step
|
23
23
|
from p115client import check_response, P115Client
|
24
|
-
from p115client.const import AVAILABLE_APP_IDS
|
25
24
|
from p115client.exception import P115OSError, AuthenticationError, LoginError
|
26
25
|
|
27
26
|
from .util import get_status_code, is_timeouterror
|
@@ -55,7 +54,7 @@ class ComparedWithID[T]:
|
|
55
54
|
|
56
55
|
def generate_auth_factory(
|
57
56
|
client: str | P115Client,
|
58
|
-
app_ids: Iterable[int]
|
57
|
+
app_ids: Iterable[int],
|
59
58
|
**request_kwargs,
|
60
59
|
) -> Callable:
|
61
60
|
"""利用一个已登录设备的 cookies,产生若干开放应用的 access_token
|
@@ -238,7 +237,7 @@ def make_pool[T](
|
|
238
237
|
|
239
238
|
def auth_pool(
|
240
239
|
client: str | P115Client,
|
241
|
-
app_ids: Iterable[int]
|
240
|
+
app_ids: Iterable[int],
|
242
241
|
heap: None | list[tuple[float, dict | ComparedWithID[dict]]] = None,
|
243
242
|
cooldown_time: int | float = 1,
|
244
243
|
live_time: int | float = 7000,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: p115client
|
3
|
-
Version: 0.0.5.11.
|
3
|
+
Version: 0.0.5.11.7.1
|
4
4
|
Summary: Python 115 webdisk client.
|
5
5
|
Home-page: https://github.com/ChenyangGao/p115client
|
6
6
|
License: MIT
|
@@ -108,7 +108,7 @@ client = P115Client(Path("~/115-cookies.txt").expanduser(), check_for_relogin=Tr
|
|
108
108
|
|
109
109
|
如果你有一个申请通过的开放接口的应用,则可以创建开放接口的客户端实例
|
110
110
|
|
111
|
-
你可以直接从一个 `P115Client`
|
111
|
+
你可以直接从一个 `P115Client` 实例拿到授权(自动扫码登录并授权)
|
112
112
|
|
113
113
|
```python
|
114
114
|
app_id = <开放接口应用的 AppID>
|
@@ -1,26 +1,26 @@
|
|
1
1
|
LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
2
2
|
p115client/__init__.py,sha256=1mx7njuAlqcuEWONTjSiiGnXyyNyqOcJyNX1FMHqQ-4,214
|
3
3
|
p115client/_upload.py,sha256=RTYpM_EDFuI3O7yf08f13NdeG0iD03o_V4H6Je6Nsr8,30754
|
4
|
-
p115client/client.py,sha256=
|
5
|
-
p115client/const.py,sha256=
|
4
|
+
p115client/client.py,sha256=vRFeTy3SjoWu4uqmsZWkRl9xdXe0S1CrvoFXEACamvc,772745
|
5
|
+
p115client/const.py,sha256=KqDGr9KsOnSkNVM3RIdQGptCMHbidMmZ_ffyFPiniww,7654
|
6
6
|
p115client/exception.py,sha256=O4SlfjbtI9GPjzbzJrFaFUZENJFz2qA3VDEKZfdhHbc,3590
|
7
7
|
p115client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
p115client/tool/__init__.py,sha256=NjT9rroMhLwKI7UlpSCksSsnB3GexXzxvhfunNWzjY0,386
|
9
|
-
p115client/tool/attr.py,sha256=
|
10
|
-
p115client/tool/download.py,sha256
|
9
|
+
p115client/tool/attr.py,sha256=VRte9LuE2YG8nPIxbeetdzDJgZL5ZFVp7RzjpIXUPN4,2914
|
10
|
+
p115client/tool/download.py,sha256=CZJE5f1SHi26eCNTPcF5VjSoht8WTUYravEG219i4gk,61534
|
11
11
|
p115client/tool/edit.py,sha256=kRz-Ee7KuNNlHhcVi4uHdh9DSfF1ZxUREIhK9x4hNIE,17771
|
12
12
|
p115client/tool/export_dir.py,sha256=1r2qDuYIirtDkCBQfYXh6lbm06IStRpiom-ZjtIYdbo,24502
|
13
13
|
p115client/tool/fs_files.py,sha256=XTG12a_MVwYI4p1hs-xMol-AQsa8C9pWFt0BUzlQCws,15634
|
14
14
|
p115client/tool/history.py,sha256=qquCiiOIRpxOqmyXbmdwS_qpfPkduJilM6AGuOufrYU,7462
|
15
|
-
p115client/tool/iterdir.py,sha256=
|
15
|
+
p115client/tool/iterdir.py,sha256=dXBMPfxPzRcFhBpnBT3X1LYkhc3l31rYCLRKRFbggSk,200498
|
16
16
|
p115client/tool/life.py,sha256=ceweN2uNKYxigSOaBQ4Abo5u05zqppRm_P7k-_rHjcA,17301
|
17
|
-
p115client/tool/pool.py,sha256=
|
17
|
+
p115client/tool/pool.py,sha256=H65VhoNxQC6xWSL1THq_PximWnBOqB4EfU6kWBTAnlA,13946
|
18
18
|
p115client/tool/request.py,sha256=rjXuQwRganE5Z-4rfgnyPFjE4jzdQSLdIs9s0cIDshU,7043
|
19
19
|
p115client/tool/upload.py,sha256=i6laoeG7GdNO7hvCDVBy8Yv2Is800wL7O5na6a3v70g,15971
|
20
20
|
p115client/tool/util.py,sha256=0o9TrXdoPcljgxDDRdxRon41bq1OjuUYCWsR0XLfmPo,3357
|
21
21
|
p115client/tool/xys.py,sha256=vU28Px2yeQzIxxGkopJIpvV6TdOnWJ5xB6NPXpTgM0Y,10306
|
22
22
|
p115client/type.py,sha256=7kOp98uLaYqcTTCgCrb3DRcl8ukMpn7ibsnVvtw2nG8,6250
|
23
|
-
p115client-0.0.5.11.
|
24
|
-
p115client-0.0.5.11.
|
25
|
-
p115client-0.0.5.11.
|
26
|
-
p115client-0.0.5.11.
|
23
|
+
p115client-0.0.5.11.7.1.dist-info/LICENSE,sha256=o5242_N2TgDsWwFhPn7yr8YJNF7XsJM5NxUMtcT97bc,1100
|
24
|
+
p115client-0.0.5.11.7.1.dist-info/METADATA,sha256=gLBpBgItF8bDZtseomQxMYZP4Qi7MYaNX3M3JaVrm8U,8194
|
25
|
+
p115client-0.0.5.11.7.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
26
|
+
p115client-0.0.5.11.7.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|