satori-python-core 0.16.4__tar.gz → 0.16.6__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.
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/PKG-INFO +12 -5
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/README.md +11 -4
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/pyproject.toml +2 -1
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/__init__.py +1 -1
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/element.py +5 -2
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/parser.py +2 -2
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/.mina/core.toml +0 -0
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/LICENSE +0 -0
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/const.py +0 -0
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/event.py +0 -0
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/exception.py +0 -0
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/model.py +0 -0
- {satori_python_core-0.16.4 → satori_python_core-0.16.6}/src/satori/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: satori-python-core
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.6
|
|
4
4
|
Summary: Satori Protocol SDK for python, specify common part
|
|
5
5
|
Home-page: https://github.com/RF-Tar-Railt/satori-python
|
|
6
6
|
Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
|
|
@@ -71,10 +71,17 @@ pip install satori-python-server
|
|
|
71
71
|
|
|
72
72
|
### 官方适配器
|
|
73
73
|
|
|
74
|
-
| 适配器 | 安装 |
|
|
75
|
-
|
|
76
|
-
| Satori | `pip install satori-python-adapter-satori` |
|
|
77
|
-
| OneBot V11 | `pip install satori-python-adapter-onebot11` |
|
|
74
|
+
| 适配器 | 安装 | 路径 |
|
|
75
|
+
|------------|----------------------------------------------|--------------------------------------------------------------------|
|
|
76
|
+
| Satori | `pip install satori-python-adapter-satori` | satori.adapters.satori |
|
|
77
|
+
| OneBot V11 | `pip install satori-python-adapter-onebot11` | satori.adapters.onebot11.forward, satori.adapters.onebot11.reverse |
|
|
78
|
+
| Console | `pip install satori-python-adapter-console` | satori.adapters.console |
|
|
79
|
+
|
|
80
|
+
### 社区适配器
|
|
81
|
+
|
|
82
|
+
| 适配器 | 安装 | 路径 |
|
|
83
|
+
|-------------------|-----------------------|--------------|
|
|
84
|
+
| nekobox(Lagrange) | `pip install nekobox` | nekobox.main |
|
|
78
85
|
|
|
79
86
|
## 使用
|
|
80
87
|
|
|
@@ -47,10 +47,17 @@ pip install satori-python-server
|
|
|
47
47
|
|
|
48
48
|
### 官方适配器
|
|
49
49
|
|
|
50
|
-
| 适配器 | 安装 |
|
|
51
|
-
|
|
52
|
-
| Satori | `pip install satori-python-adapter-satori` |
|
|
53
|
-
| OneBot V11 | `pip install satori-python-adapter-onebot11` |
|
|
50
|
+
| 适配器 | 安装 | 路径 |
|
|
51
|
+
|------------|----------------------------------------------|--------------------------------------------------------------------|
|
|
52
|
+
| Satori | `pip install satori-python-adapter-satori` | satori.adapters.satori |
|
|
53
|
+
| OneBot V11 | `pip install satori-python-adapter-onebot11` | satori.adapters.onebot11.forward, satori.adapters.onebot11.reverse |
|
|
54
|
+
| Console | `pip install satori-python-adapter-console` | satori.adapters.console |
|
|
55
|
+
|
|
56
|
+
### 社区适配器
|
|
57
|
+
|
|
58
|
+
| 适配器 | 安装 | 路径 |
|
|
59
|
+
|-------------------|-----------------------|--------------|
|
|
60
|
+
| nekobox(Lagrange) | `pip install nekobox` | nekobox.main |
|
|
54
61
|
|
|
55
62
|
## 使用
|
|
56
63
|
|
|
@@ -23,7 +23,7 @@ classifiers = [
|
|
|
23
23
|
"Programming Language :: Python :: 3.12",
|
|
24
24
|
"Operating System :: OS Independent",
|
|
25
25
|
]
|
|
26
|
-
version = "0.16.
|
|
26
|
+
version = "0.16.6"
|
|
27
27
|
|
|
28
28
|
[project.license]
|
|
29
29
|
text = "MIT"
|
|
@@ -48,6 +48,7 @@ dev = [
|
|
|
48
48
|
"fix-future-annotations>=0.5.0",
|
|
49
49
|
"mina-build<0.6,>=0.5.1",
|
|
50
50
|
"pdm-mina>=0.3.2",
|
|
51
|
+
"nonechat<0.7.0,>=0.6.0",
|
|
51
52
|
]
|
|
52
53
|
|
|
53
54
|
[tool.pdm.build]
|
|
@@ -180,6 +180,7 @@ class Resource(Element):
|
|
|
180
180
|
raw: Optional[Union[bytes, BytesIO]] = None,
|
|
181
181
|
mime: Optional[str] = None,
|
|
182
182
|
name: Optional[str] = None,
|
|
183
|
+
duration: Optional[float] = None,
|
|
183
184
|
poster: Optional[str] = None,
|
|
184
185
|
extra: Optional[dict[str, Any]] = None,
|
|
185
186
|
cache: Optional[bool] = None,
|
|
@@ -198,6 +199,8 @@ class Resource(Element):
|
|
|
198
199
|
raise ValueError(f"{cls} need at least one of url, path and raw")
|
|
199
200
|
if name is not None:
|
|
200
201
|
data["title"] = name
|
|
202
|
+
if duration is not None and cls is Audio:
|
|
203
|
+
data["duration"] = duration
|
|
201
204
|
if poster is not None and cls in (Video, Audio, File):
|
|
202
205
|
data["poster"] = poster
|
|
203
206
|
if cache is not None:
|
|
@@ -231,7 +234,7 @@ class Image(Resource):
|
|
|
231
234
|
class Audio(Resource):
|
|
232
235
|
"""<audio> 元素用于表示语音。"""
|
|
233
236
|
|
|
234
|
-
duration: Optional[
|
|
237
|
+
duration: Optional[float] = None
|
|
235
238
|
poster: Optional[str] = None
|
|
236
239
|
|
|
237
240
|
__names__ = ("src", "title", "duration", "poster")
|
|
@@ -243,7 +246,7 @@ class Video(Resource):
|
|
|
243
246
|
|
|
244
247
|
width: Optional[int] = None
|
|
245
248
|
height: Optional[int] = None
|
|
246
|
-
duration: Optional[
|
|
249
|
+
duration: Optional[float] = None
|
|
247
250
|
poster: Optional[str] = None
|
|
248
251
|
|
|
249
252
|
__names__ = ("src", "title", "width", "height", "duration", "poster")
|
|
@@ -358,9 +358,9 @@ def parse(src: str, context: Optional[dict] = None):
|
|
|
358
358
|
def parse_content(source: str, _start: bool, _end: bool):
|
|
359
359
|
source = unescape(source)
|
|
360
360
|
if _start:
|
|
361
|
-
source = re.sub(r"^\s*\n\s*", "", source, re.MULTILINE)
|
|
361
|
+
source = re.sub(r"^\s*\n\s*", "", source, flags=re.MULTILINE)
|
|
362
362
|
if _end:
|
|
363
|
-
source = re.sub(r"\s*\n\s*$", "", source, re.MULTILINE)
|
|
363
|
+
source = re.sub(r"\s*\n\s*$", "", source, flags=re.MULTILINE)
|
|
364
364
|
push_text(source)
|
|
365
365
|
|
|
366
366
|
tag_pat = tag_pat2 if context is not None else tag_pat1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|