u
This commit is contained in:
@@ -4,7 +4,7 @@ import socket
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
# 加载 默认配置文件 envar.py 和 本机配置文件 (envar.本机编码.py 例如 envar.lin237.py)
|
# 加载 默认配置文件 envar.py 和 本机配置文件 (envar.本机编码.py 例如 envar.lin237.py)
|
||||||
def load_envar(fromPath=None):
|
def load_envar(fromPath=''):
|
||||||
# Get current OS type
|
# Get current OS type
|
||||||
if sys.platform.startswith('win'):
|
if sys.platform.startswith('win'):
|
||||||
ostype = 'win'
|
ostype = 'win'
|
||||||
@@ -20,8 +20,6 @@ def load_envar(fromPath=None):
|
|||||||
lanip = s.getsockname()[0]
|
lanip = s.getsockname()[0]
|
||||||
s.close()
|
s.close()
|
||||||
# Load environment variables
|
# Load environment variables
|
||||||
if fromPath is None:
|
|
||||||
fromPath = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
envFileLocal = os.path.join(fromPath, "envar." + ostype + lanip.split(".")[-1] + ".py") # 本主机配置文件
|
envFileLocal = os.path.join(fromPath, "envar." + ostype + lanip.split(".")[-1] + ".py") # 本主机配置文件
|
||||||
envFileDefault = os.path.join(fromPath, "envar.py") # 默认配置文件
|
envFileDefault = os.path.join(fromPath, "envar.py") # 默认配置文件
|
||||||
# 总是加载默认配置文件,作为基础配置
|
# 总是加载默认配置文件,作为基础配置
|
||||||
|
|||||||
Reference in New Issue
Block a user