summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLint Action <[email protected]>2023-01-28 14:43:52 +0000
committerLint Action <[email protected]>2023-01-28 14:43:52 +0000
commitf44f9e148c0e5fc563c057efe923e2d41a63c27d (patch)
tree658e4bac5bc3636af797a63956a9e7d2859d7fef
parent05d28f1d3a23dfa7f293c3ee5fc1c3876f4014a7 (diff)
downloadATRI-f44f9e148c0e5fc563c057efe923e2d41a63c27d.tar.gz
ATRI-f44f9e148c0e5fc563c057efe923e2d41a63c27d.tar.bz2
ATRI-f44f9e148c0e5fc563c057efe923e2d41a63c27d.zip
:rotating_light: 自动进行代码格式化
-rw-r--r--ATRI/plugins/manage/__init__.py6
-rw-r--r--ATRI/plugins/manage/listener.py2
-rw-r--r--ATRI/plugins/manage/plugin.py2
-rw-r--r--ATRI/service.py8
4 files changed, 9 insertions, 9 deletions
diff --git a/ATRI/plugins/manage/__init__.py b/ATRI/plugins/manage/__init__.py
index 90d1a79..30d37c5 100644
--- a/ATRI/plugins/manage/__init__.py
+++ b/ATRI/plugins/manage/__init__.py
@@ -499,7 +499,9 @@ async def _(
await remove_nonebot_plugin.finish(result)
-upgrade_nonebot_plugin = plugin.on_command("更新插件", "更新来自 Nonebot 商店的插件", aliases={"升级插件"})
+upgrade_nonebot_plugin = plugin.on_command(
+ "更新插件", "更新来自 Nonebot 商店的插件", aliases={"升级插件"}
+)
@upgrade_nonebot_plugin.handle()
@@ -507,7 +509,7 @@ async def _(event: MessageEvent):
result = NonebotPluginManager.upgrade_plugin()
if not result:
await upgrade_nonebot_plugin.finish("当前没有插件可更新...")
-
+
msg = "更新完成~! 成功更新:" + "\n".join(map(str, result))
await upgrade_nonebot_plugin.finish(msg)
diff --git a/ATRI/plugins/manage/listener.py b/ATRI/plugins/manage/listener.py
index fb66a9c..84139f0 100644
--- a/ATRI/plugins/manage/listener.py
+++ b/ATRI/plugins/manage/listener.py
@@ -21,7 +21,7 @@ async def _(matcher: Matcher, event: MessageEvent):
if not "nonebot_" in plugin_name:
return
-
+
if not "gocqhttp" in plugin_name:
serv = ServiceTools(plugin_name)
try:
diff --git a/ATRI/plugins/manage/plugin.py b/ATRI/plugins/manage/plugin.py
index 3fe2db7..d46d1ef 100644
--- a/ATRI/plugins/manage/plugin.py
+++ b/ATRI/plugins/manage/plugin.py
@@ -27,7 +27,7 @@ class NonebotPluginManager:
if not self._conf_path.is_file():
with open(self._conf_path, "w", encoding="utf-8") as w:
w.write(json.dumps(list()))
-
+
with open(".env.prod", "w", encoding="utf-8") as w:
w.write("# 请在此填写来自 Nonebot 商店的插件设置, 填写后需重启以生效")
diff --git a/ATRI/service.py b/ATRI/service.py
index d6d7746..85eed9f 100644
--- a/ATRI/service.py
+++ b/ATRI/service.py
@@ -145,13 +145,11 @@ class Service:
self._main_cmd = (cmd,)
return self
-
+
def is_nonebot_plugin(self) -> "Service":
cmd_list = self.__load_cmds()
name = "请参考对应插件文档"
- cmd_list[name] = CommandInfo(
- type="ignore", docs=str(), aliases=list()
- ).dict()
+ cmd_list[name] = CommandInfo(type="ignore", docs=str(), aliases=list()).dict()
self.__save_cmds(cmd_list)
return self
@@ -404,7 +402,7 @@ class ServiceTools:
)
return ServiceInfo.parse_file(path)
-
+
def del_service(self):
path = SERVICES_DIR / f"{self.service}.json"
path.unlink()