nonebot-plugin-latex 0.0.3__tar.gz → 0.0.3.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/PKG-INFO +3 -4
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex/__init__.py +23 -5
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex/main.py +14 -26
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex.egg-info/PKG-INFO +3 -4
- nonebot_plugin_latex-0.0.3.2/nonebot_plugin_latex.egg-info/requires.txt +3 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/pyproject.toml +6 -4
- nonebot_plugin_latex-0.0.3/nonebot_plugin_latex.egg-info/requires.txt +0 -4
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/LICENSE +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/README.md +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex/config.py +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex/converter.py +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex/data.py +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex.egg-info/SOURCES.txt +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex.egg-info/dependency_links.txt +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex.egg-info/top_level.txt +0 -0
- {nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nonebot-plugin-latex
|
3
|
-
Version: 0.0.3
|
3
|
+
Version: 0.0.3.2
|
4
4
|
Summary: 通过互联网公共服务渲染LaTeX公式
|
5
5
|
Author-email: Eilles <EillesWan@outlook.com>
|
6
6
|
License: 木兰宽松许可证, 第2版
|
@@ -136,10 +136,9 @@ Project-URL: Bug Tracker, https://github.com/EillesWan/nonebot-plugin-latex/issu
|
|
136
136
|
Requires-Python: <4.0,>=3.9
|
137
137
|
Description-Content-Type: text/markdown
|
138
138
|
License-File: LICENSE
|
139
|
-
Requires-Dist: nonebot2
|
139
|
+
Requires-Dist: nonebot2<1000.0.0,>=2.2.0
|
140
140
|
Requires-Dist: httpx<0.28.0,>=0.27.0
|
141
|
-
Requires-Dist: nonebot-
|
142
|
-
Requires-Dist: nonebot-plugin-alconna
|
141
|
+
Requires-Dist: nonebot-plugin-alconna<1000.0.0,>=0.48.0
|
143
142
|
|
144
143
|
# nonebot-plugin-latex
|
145
144
|
|
{nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex/__init__.py
RENAMED
@@ -19,20 +19,38 @@ from nonebot.plugin import PluginMetadata
|
|
19
19
|
from .config import Config
|
20
20
|
from .converter import _converter, get_converter
|
21
21
|
|
22
|
-
__version__ = "0.0.3"
|
22
|
+
__version__ = "0.0.3.2"
|
23
23
|
|
24
24
|
__author__ = "Eilles"
|
25
25
|
|
26
26
|
__plugin_meta__ = PluginMetadata(
|
27
|
-
name="LaTeX
|
28
|
-
description="从互联网服务渲染LaTeX
|
27
|
+
name="LaTeX 在线渲染插件",
|
28
|
+
description="从互联网服务渲染 LaTeX 公式",
|
29
29
|
usage="发送 latex 或 公式,后接内容或回复公式信息。",
|
30
30
|
type="library",
|
31
31
|
homepage="https://github.com/EillesWan/nonebot-plugin-latex",
|
32
32
|
config=Config,
|
33
33
|
supported_adapters={
|
34
|
-
"
|
35
|
-
|
34
|
+
"nonebot.adapters.telegram",
|
35
|
+
"nonebot.adapters.dodo",
|
36
|
+
"nonebot_adapter_tailchat",
|
37
|
+
"nonebot.adapters.onebot.v11",
|
38
|
+
"nonebot.adapters.minecraft",
|
39
|
+
"nonebot.adapters.github",
|
40
|
+
"nonebot.adapters.discord",
|
41
|
+
"nonebot.adapters.mail",
|
42
|
+
"nonebot.adapters.ding",
|
43
|
+
"nonebot.adapters.console",
|
44
|
+
"nonebot.adapters.qq",
|
45
|
+
"nonebot.adapters.kritor",
|
46
|
+
"nonebot.adapters.feishu",
|
47
|
+
"nonebot.adapters.red",
|
48
|
+
"nonebot.adapters.satori",
|
49
|
+
"nonebot.adapters.onebot.v12",
|
50
|
+
"nonebot.adapters.kaiheila",
|
51
|
+
"nonebot.adapters.mirai",
|
52
|
+
"nonebot.adapters.ntchat",
|
53
|
+
}, # inherit_supported_adapters("nonebot_plugin_alconna"),
|
36
54
|
extra={"License": "Mulan PSL v2", "Author": __author__},
|
37
55
|
)
|
38
56
|
|
@@ -15,17 +15,17 @@ See the Mulan PSL v2 for more details.
|
|
15
15
|
|
16
16
|
import nonebot
|
17
17
|
|
18
|
-
from
|
18
|
+
from nonebot_plugin_alconna.uniseg import Text
|
19
19
|
|
20
|
-
# from nonebot.matcher import Matcher
|
21
20
|
|
22
21
|
nonebot.require("nonebot_plugin_alconna")
|
23
22
|
|
24
|
-
# from nonebot_plugin_alconna.util import annotation
|
25
23
|
from nonebot_plugin_alconna import (
|
26
24
|
Image as Alconna_Image,
|
25
|
+
Reply,
|
27
26
|
Text as Alconnna_Text,
|
28
27
|
UniMessage,
|
28
|
+
UniMsg
|
29
29
|
)
|
30
30
|
|
31
31
|
from .data import LATEX_PATTERN
|
@@ -47,29 +47,16 @@ command_heads = (
|
|
47
47
|
|
48
48
|
|
49
49
|
async def check_for_scan(
|
50
|
-
|
50
|
+
msg: UniMsg,
|
51
51
|
# state: T_State,
|
52
52
|
) -> bool:
|
53
53
|
"""
|
54
54
|
检查是否为 LaTeX 指令
|
55
55
|
"""
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
# event.message
|
61
|
-
for msg in event.message:
|
62
|
-
# print("这是其中一个信息---", msg)
|
63
|
-
if msg.type == "text" and (msgdata := msg.data["text"].strip()):
|
64
|
-
if msgdata.startswith(command_heads):
|
65
|
-
|
66
|
-
# print("判断:这确实是指令发出")
|
67
|
-
return True
|
68
|
-
else:
|
69
|
-
# print("判断:这不是指令")
|
70
|
-
return False
|
71
|
-
return False
|
72
|
-
return False
|
56
|
+
return any(
|
57
|
+
isinstance(seg, Text) and seg.text.strip().startswith(command_heads)
|
58
|
+
for seg in msg
|
59
|
+
)
|
73
60
|
|
74
61
|
|
75
62
|
latexg = nonebot.on_message(
|
@@ -81,18 +68,19 @@ latexg = nonebot.on_message(
|
|
81
68
|
|
82
69
|
@latexg.handle()
|
83
70
|
async def handle_pic(
|
84
|
-
|
71
|
+
msgs: UniMsg,
|
85
72
|
# state: T_State,
|
86
73
|
# arg: Optional[Message] = CommandArg(),
|
87
74
|
):
|
88
75
|
# print("正在解决reply指令……")
|
89
76
|
latexes = []
|
90
|
-
if
|
91
|
-
|
77
|
+
if msgs.has(Reply):
|
78
|
+
i = msgs[Reply, 0]
|
79
|
+
if i.msg:
|
80
|
+
latexes.extend(LATEX_PATTERN.finditer(i.msg if isinstance(i.msg, str) else i.msg.extract_plain_text()))
|
92
81
|
|
93
82
|
# print(arg)
|
94
|
-
|
95
|
-
latexes.extend(LATEX_PATTERN.finditer(event.message.extract_plain_text()))
|
83
|
+
latexes.extend(LATEX_PATTERN.finditer(msgs.extract_plain_text()))
|
96
84
|
|
97
85
|
if not latexes:
|
98
86
|
await latexg.finish(
|
{nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: nonebot-plugin-latex
|
3
|
-
Version: 0.0.3
|
3
|
+
Version: 0.0.3.2
|
4
4
|
Summary: 通过互联网公共服务渲染LaTeX公式
|
5
5
|
Author-email: Eilles <EillesWan@outlook.com>
|
6
6
|
License: 木兰宽松许可证, 第2版
|
@@ -136,10 +136,9 @@ Project-URL: Bug Tracker, https://github.com/EillesWan/nonebot-plugin-latex/issu
|
|
136
136
|
Requires-Python: <4.0,>=3.9
|
137
137
|
Description-Content-Type: text/markdown
|
138
138
|
License-File: LICENSE
|
139
|
-
Requires-Dist: nonebot2
|
139
|
+
Requires-Dist: nonebot2<1000.0.0,>=2.2.0
|
140
140
|
Requires-Dist: httpx<0.28.0,>=0.27.0
|
141
|
-
Requires-Dist: nonebot-
|
142
|
-
Requires-Dist: nonebot-plugin-alconna
|
141
|
+
Requires-Dist: nonebot-plugin-alconna<1000.0.0,>=0.48.0
|
143
142
|
|
144
143
|
# nonebot-plugin-latex
|
145
144
|
|
@@ -1,13 +1,12 @@
|
|
1
1
|
[project]
|
2
2
|
name = "nonebot-plugin-latex"
|
3
|
-
version = "0.0.3"
|
3
|
+
version = "0.0.3.2"
|
4
4
|
description = "通过互联网公共服务渲染LaTeX公式"
|
5
5
|
authors = [{ name = "Eilles", email = "EillesWan@outlook.com" }]
|
6
6
|
dependencies = [
|
7
|
-
"nonebot2",
|
7
|
+
"nonebot2>=2.2.0,<1000.0.0",
|
8
8
|
"httpx>=0.27.0,<0.28.0",
|
9
|
-
"nonebot-
|
10
|
-
"nonebot-plugin-alconna",
|
9
|
+
"nonebot-plugin-alconna>=0.48.0,<1000.0.0",
|
11
10
|
]
|
12
11
|
requires-python = ">=3.9,<4.0"
|
13
12
|
readme = "README.md"
|
@@ -16,3 +15,6 @@ license = { file = "LICENSE" }
|
|
16
15
|
[project.urls]
|
17
16
|
"Homepage" = "https://github.com/EillesWan/nonebot-plugin-latex"
|
18
17
|
"Bug Tracker" = "https://github.com/EillesWan/nonebot-plugin-latex/issues"
|
18
|
+
|
19
|
+
[tool.pyright]
|
20
|
+
typeCheckingMode = "standard"
|
File without changes
|
File without changes
|
File without changes
|
{nonebot_plugin_latex-0.0.3 → nonebot_plugin_latex-0.0.3.2}/nonebot_plugin_latex/converter.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|