Difficult-Rocket/.github/workflows/get_info.py
2024-01-20 14:28:14 +08:00

43 lines
1.0 KiB
Python

# -------------------------------
# Difficult Rocket
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
# All rights reserved
# -------------------------------
import os
import sys
import tomli_w
import io
sys.path.append(os.path.abspath(os.curdir))
is_github = "-github" in sys.argv
if is_github:
stdout = sys.stdout
sys.stdout = io.StringIO()
try:
from Difficult_Rocket import DR_status
except ImportError:
raise
if is_github:
sys.stdout = stdout
if sys.argv == [__file__]: # 没有输入参数,直接输出默认信息并输出
print(sys.version)
from Difficult_Rocket.utils import tools
# 重置窗口信息
config_file = tools.load_file("./config/main.toml")
config_file["window"]["width"] = 1024
config_file["window"]["height"] = 768
tomli_w.dump(config_file, open("./config/main.toml", "wb"))
elif os.path.abspath(os.curdir) in sys.path and "-github" in sys.argv:
print(f"DR_version={DR_status.DR_version}")
print(f"Build_version={DR_status.Build_version}")