u
This commit is contained in:
@@ -20,8 +20,10 @@ def load_envar():
|
|||||||
lanip = s.getsockname()[0]
|
lanip = s.getsockname()[0]
|
||||||
s.close()
|
s.close()
|
||||||
# Load environment variables
|
# Load environment variables
|
||||||
envFileLocal = os.path.dirname(os.path.abspath(__file__)) + "/envar." + ostype + lanip.split(".")[-1] + ".py" # 本主机配置文件
|
this_script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
envFileDefault = os.path.dirname(os.path.abspath(__file__)) + "/envar.py" # 默认配置文件
|
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}")
|
print(f"*** Loading default envar file: {envFileDefault}")
|
||||||
if not os.path.exists(envFileDefault):
|
if not os.path.exists(envFileDefault):
|
||||||
|
|||||||
Reference in New Issue
Block a user