satori-python 0.17.2__tar.gz → 0.17.4__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-0.17.2 → satori_python-0.17.4}/PKG-INFO +2 -1
- {satori_python-0.17.2 → satori_python-0.17.4}/README.md +1 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/pyproject.toml +6 -4
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/__init__.py +1 -1
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/parser.py +1 -1
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/server/__init__.py +14 -4
- {satori_python-0.17.2 → satori_python-0.17.4}/LICENSE +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/__init__.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/account.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/account.pyi +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/config.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/network/__init__.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/network/base.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/network/util.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/network/webhook.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/network/websocket.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/client/protocol.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/const.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/element.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/event.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/exception.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/model.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/server/adapter.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/server/connection.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/server/formdata.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/server/model.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/server/route.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/server/utils.py +0 -0
- {satori_python-0.17.2 → satori_python-0.17.4}/src/satori/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: satori-python
|
|
3
|
-
Version: 0.17.
|
|
3
|
+
Version: 0.17.4
|
|
4
4
|
Summary: Satori Protocol SDK for python
|
|
5
5
|
Home-page: https://github.com/RF-Tar-Railt/satori-python
|
|
6
6
|
Author-Email: RF-Tar-Railt <rf_tar_railt@qq.com>
|
|
@@ -84,6 +84,7 @@ pip install satori-python-server
|
|
|
84
84
|
| Satori | `pip install satori-python-adapter-satori` | satori.adapters.satori |
|
|
85
85
|
| OneBot V11 | `pip install satori-python-adapter-onebot11` | satori.adapters.onebot11.forward, satori.adapters.onebot11.reverse |
|
|
86
86
|
| Console | `pip install satori-python-adapter-console` | satori.adapters.console |
|
|
87
|
+
| Milky | `pip install satori-python-adapter-milky` | satori.adapters.milky.main, satori.adapters.milky.webhook |
|
|
87
88
|
|
|
88
89
|
### 社区适配器
|
|
89
90
|
|
|
@@ -52,6 +52,7 @@ pip install satori-python-server
|
|
|
52
52
|
| Satori | `pip install satori-python-adapter-satori` | satori.adapters.satori |
|
|
53
53
|
| OneBot V11 | `pip install satori-python-adapter-onebot11` | satori.adapters.onebot11.forward, satori.adapters.onebot11.reverse |
|
|
54
54
|
| Console | `pip install satori-python-adapter-console` | satori.adapters.console |
|
|
55
|
+
| Milky | `pip install satori-python-adapter-milky` | satori.adapters.milky.main, satori.adapters.milky.webhook |
|
|
55
56
|
|
|
56
57
|
### 社区适配器
|
|
57
58
|
|
|
@@ -29,7 +29,7 @@ classifiers = [
|
|
|
29
29
|
"Programming Language :: Python :: 3.12",
|
|
30
30
|
"Operating System :: OS Independent",
|
|
31
31
|
]
|
|
32
|
-
version = "0.17.
|
|
32
|
+
version = "0.17.4"
|
|
33
33
|
|
|
34
34
|
[project.license]
|
|
35
35
|
text = "MIT"
|
|
@@ -75,7 +75,7 @@ excludes = [
|
|
|
75
75
|
composite = [
|
|
76
76
|
"isort ./src/ ./example/",
|
|
77
77
|
"black ./src/ ./example/",
|
|
78
|
-
"ruff check
|
|
78
|
+
"ruff check",
|
|
79
79
|
]
|
|
80
80
|
|
|
81
81
|
[tool.pdm.version]
|
|
@@ -99,7 +99,9 @@ extra_standard_library = [
|
|
|
99
99
|
line-length = 120
|
|
100
100
|
target-version = "py310"
|
|
101
101
|
exclude = [
|
|
102
|
-
"
|
|
102
|
+
"exam_qps.py",
|
|
103
|
+
"exam1.py",
|
|
104
|
+
"exam2.py",
|
|
103
105
|
]
|
|
104
106
|
|
|
105
107
|
[tool.ruff.lint]
|
|
@@ -117,7 +119,7 @@ ignore = [
|
|
|
117
119
|
"F403",
|
|
118
120
|
"F405",
|
|
119
121
|
"C901",
|
|
120
|
-
"
|
|
122
|
+
"T201",
|
|
121
123
|
]
|
|
122
124
|
|
|
123
125
|
[tool.pyright]
|
|
@@ -306,7 +306,7 @@ def parse_tokens(tokens: list[str | Token], context: dict | None = None) -> list
|
|
|
306
306
|
while mat := attr_pat.search(token.extra):
|
|
307
307
|
key = mat.group(1)
|
|
308
308
|
groupdict = mat.groupdict()
|
|
309
|
-
v2 = groupdict.get("value2"
|
|
309
|
+
v2 = groupdict.get("value2") or groupdict.get("value1")
|
|
310
310
|
curly = groupdict.get("curly")
|
|
311
311
|
if curly and context is not None:
|
|
312
312
|
attrs[key] = interpolate(curly, context)
|
|
@@ -308,17 +308,27 @@ class Server(Service, RouterMixin):
|
|
|
308
308
|
self_id: str = request.headers.get("X-Self-ID") or request.headers.get("Satori-User-ID") # type: ignore
|
|
309
309
|
|
|
310
310
|
for _router in self._adapters:
|
|
311
|
-
if action
|
|
311
|
+
if action in _router.routes:
|
|
312
|
+
func = _router.routes[action]
|
|
313
|
+
elif action.startswith("internal") and "internal/*" in _router.routes:
|
|
314
|
+
func = _router.routes["internal/*"]
|
|
315
|
+
else:
|
|
312
316
|
continue
|
|
313
317
|
if not _router.ensure(platform, self_id):
|
|
314
318
|
continue
|
|
315
|
-
return await _request_handler(action, request,
|
|
319
|
+
return await _request_handler(action, request, func, platform, self_id)
|
|
316
320
|
if action in self.routes:
|
|
317
321
|
return await _request_handler(action, request, self.routes[action], platform, self_id)
|
|
322
|
+
if action.startswith("internal") and "internal/*" in self.routes:
|
|
323
|
+
return await _request_handler(action, request, self.routes["internal/*"], platform, self_id)
|
|
318
324
|
for _router in self.routers:
|
|
319
|
-
if action
|
|
325
|
+
if action in _router.routes:
|
|
326
|
+
func = _router.routes[action]
|
|
327
|
+
elif action.startswith("internal") and "internal/*" in _router.routes:
|
|
328
|
+
func = _router.routes["internal/*"]
|
|
329
|
+
else:
|
|
320
330
|
continue
|
|
321
|
-
return await _request_handler(action, request,
|
|
331
|
+
return await _request_handler(action, request, func, platform, self_id)
|
|
322
332
|
return Response(status_code=404, content=action)
|
|
323
333
|
|
|
324
334
|
async def proxy_url_handler(self, request: StarletteRequest):
|
|
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
|