mirror of https://github.com/Mai-with-u/MaiBot.git
fix: 修复webUI未正确处理行末注释的问题
parent
5195e7baf1
commit
e5d19d4bd9
6
webui.py
6
webui.py
|
|
@ -98,10 +98,14 @@ def parse_env_config(config_file):
|
||||||
# 逐行处理配置
|
# 逐行处理配置
|
||||||
for line in lines:
|
for line in lines:
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
# 忽略空行和注释
|
# 忽略空行和注释行
|
||||||
if not line or line.startswith("#"):
|
if not line or line.startswith("#"):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# 处理行尾注释
|
||||||
|
if "#" in line:
|
||||||
|
line = line.split("#")[0].strip()
|
||||||
|
|
||||||
# 拆分键值对
|
# 拆分键值对
|
||||||
key, value = line.split("=", 1)
|
key, value = line.split("=", 1)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue