3 Star 5 Fork 2

CorttChan/ArchOctopus

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
tasks.py 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
CorttChan 提交于 2022-09-08 23:46 . 更新update模块
"""
版本信息
"""
import json
import os
import glob
from datetime import datetime, timedelta
from archoctopus.version import VERSION
def update_plugin_version() -> None:
"""
更新插件版本信息
"""
info = dict()
for name in glob.glob("./archoctopus/plugins/*.py"):
with open(name, 'r', encoding="utf-8") as plugin_file:
for line in plugin_file.readlines():
if line.startswith("# version:"):
info[os.path.basename(name)] = line[10:].strip()
break
else:
info[os.path.basename(name)] = "0.0.1"
with open('./update/plugin_version', 'w') as f:
json.dump(info, f)
def update_release_version() -> None:
"""
更新软件版本信息
"""
date_now = datetime.utcnow() + timedelta(hours=8)
release_version_info = {
"version": VERSION,
"date": date_now.strftime("%Y-%m-%d %H:%M:%S"),
"desc": "",
"url": "https://github.com/CorttChan/ArchOctopus/releases/latest",
"notes": "",
}
with open('./update/release_version', 'w') as f:
json.dump(release_version_info, f)
if __name__ == '__main__':
if not os.path.exists("./update"):
os.mkdir("./update")
update_plugin_version()
update_release_version()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/corttchan/ArchOctopus.git
git@gitee.com:corttchan/ArchOctopus.git
corttchan
ArchOctopus
ArchOctopus
main

搜索帮助

Cb406eda 1850385 E526c682 1850385