mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-21 15:58:19 +00:00
CI: fix a bug
This commit is contained in:
parent
2a75572349
commit
53b2340fe5
30
list.json
30
list.json
@ -1069,36 +1069,6 @@
|
||||
"supported": true,
|
||||
"des_short": "miaolang 喵语翻译机",
|
||||
"des": "喵语翻译机\n\n指令:\n- `,enmiao <待转换文本> (支持回复消息)` (转换指定文本到喵语)\n- `,demiao <喵语> (支持回复消息)` (转换喵语到明文)"
|
||||
},
|
||||
{
|
||||
"name": "chatgpt",
|
||||
"version": "1.0",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "4.129 kb",
|
||||
"supported": true,
|
||||
"des_short": ":recycle: Reformat All Plugins",
|
||||
"des": ""
|
||||
},
|
||||
{
|
||||
"name": "today_in_history",
|
||||
"version": "1.0",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "2.643 kb",
|
||||
"supported": true,
|
||||
"des_short": ":recycle: Reformat All Plugins",
|
||||
"des": ""
|
||||
},
|
||||
{
|
||||
"name": "trace",
|
||||
"version": "1.0",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "20.483 kb",
|
||||
"supported": true,
|
||||
"des_short": ":recycle: Reformat All Plugins",
|
||||
"des": ""
|
||||
}
|
||||
]
|
||||
}
|
@ -26,20 +26,20 @@ delete = bool(main["commit"]["message"].startswith("Delete"))
|
||||
for idx, plugins_ in enumerate([plugins, alpha_plugins]):
|
||||
with open(f"{list_json_start[idx]}list.json", "r", encoding="utf8") as f:
|
||||
list_json = json.load(f)
|
||||
plugin_map = {i["name"]: i for i in list_json["list"]}
|
||||
for plugin in plugins_:
|
||||
exist = False
|
||||
for plug_dict in list_json["list"]:
|
||||
if plug_dict["name"] == plugin:
|
||||
exist = True
|
||||
old_version = decimal.Decimal(plug_dict["version"])
|
||||
plug_dict["version"] = str(old_version + decimal.Decimal("0.01"))
|
||||
plug_dict[
|
||||
"size"
|
||||
] = f"{os.path.getsize(f'{list_json_start[idx]}{plugin}{os.sep}main.py') / 1000} kb"
|
||||
if delete:
|
||||
list_json["list"].remove(plug_dict)
|
||||
break
|
||||
if not exist:
|
||||
if plugin in plugin_map:
|
||||
if delete:
|
||||
plugin_map.pop(plugin)
|
||||
list_json["list"] = list(plugin_map.values())
|
||||
continue
|
||||
plug_dict = plugin_map[plugin]
|
||||
old_version = decimal.Decimal(plug_dict["version"])
|
||||
plug_dict["version"] = str(old_version + decimal.Decimal("0.01"))
|
||||
plug_dict[
|
||||
"size"
|
||||
] = f"{os.path.getsize(f'{list_json_start[idx]}{plugin}{os.sep}main.py') / 1000} kb"
|
||||
else:
|
||||
short_des = main["commit"]["message"].split("\nCo-authored-by")[0].strip()
|
||||
list_json["list"].append(
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user