This commit is contained in:
Luk
2024-12-11 12:59:34 +08:00
parent be5ba46d8b
commit af602f1c0f

View File

@@ -20,8 +20,10 @@ def load_envar():
lanip = s.getsockname()[0]
s.close()
# Load environment variables
envFileLocal = os.path.dirname(os.path.abspath(__file__)) + "/envar." + ostype + lanip.split(".")[-1] + ".py" # 本主机配置文件
envFileDefault = os.path.dirname(os.path.abspath(__file__)) + "/envar.py" # 默认配置文件
this_script_dir = os.path.dirname(os.path.abspath(__file__))
calling_script_dir = os.path.dirname(os.path.abspath(sys.argv[0])) # Get the directory of the calling script
envFileLocal = os.path.join(calling_script_dir, "envar." + ostype + lanip.split(".")[-1] + ".py") # 本主机配置文件
envFileDefault = os.path.join(calling_script_dir, "envar.py") # 默认配置文件
# 总是加载默认配置文件,作为基础配置
print(f"*** Loading default envar file: {envFileDefault}")
if not os.path.exists(envFileDefault):