重构了main.html的主函数
重构了大量的页面的sidebar 优化了代码结构
This commit is contained in:
12
start_all.py
12
start_all.py
@@ -120,15 +120,16 @@ def start_api():
|
||||
print(f"❌ 找不到主程序文件: {main_py}")
|
||||
return False
|
||||
|
||||
# 启动进程
|
||||
# 启动进程(不重定向输出,让 Python logging 模块自己处理日志文件)
|
||||
env = os.environ.copy()
|
||||
env['PYTHONUNBUFFERED'] = '1'
|
||||
|
||||
log_file = open(os.devnull, 'w') # 忽略输出
|
||||
proc = subprocess.Popen(
|
||||
[str(venv_python), str(main_py)],
|
||||
cwd=str(SCRIPT_DIR),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
stdout=log_file,
|
||||
stderr=log_file,
|
||||
text=True,
|
||||
bufsize=1,
|
||||
env=env
|
||||
@@ -172,11 +173,12 @@ def start_web():
|
||||
env = os.environ.copy()
|
||||
env['PYTHONUNBUFFERED'] = '1'
|
||||
|
||||
log_file = open(os.devnull, 'w') # 忽略输出
|
||||
proc = subprocess.Popen(
|
||||
[sys.executable, '-m', 'http.server', str(web_port)],
|
||||
cwd=str(web_root),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
stdout=log_file,
|
||||
stderr=log_file,
|
||||
text=True,
|
||||
bufsize=1,
|
||||
env=env
|
||||
|
||||
Reference in New Issue
Block a user