예제 #1
0
	def __init__(self):
		xml = SimpleXML(Path.executeDirectory())
		binSect = xml.openSection("bin.xml")
		if binSect is None:
			Listener().cbError("config file 'bin.xml' is not exist.")
			engine.exit(1)
		self.__binSect = binSect
예제 #2
0
def _initEnvironment():
    """
	初始化环境变量
	"""
    sys.path.append(script2sys(Path.executeDirectory()))  # 将程序根目录添加到环境变量
    for root in CustomConfig().syscodeTplRoots:  # 将配置文件所在路径加入环境变量
        sys.path.append(root)
    if CustomConfig().syscodeSrcPluginRoot != "":
        sys.path.append(CustomConfig().syscodeSrcPluginRoot)  # 数据源插件根目录
    if CustomConfig().syscodeDstPluginRoot != "":
        sys.path.append(CustomConfig().syscodeDstPluginRoot)  # 数据导出插件根目录
예제 #3
0
 def __init(self):
     xml = SimpleXML(Path.executeDirectory())
     cfgSect = xml.openSection("config.xml")
     if cfgSect is None:
         raise ConfigFixException("errNoConfig", file="config.xml")
     self.__cfgSect = cfgSect
예제 #4
0
 def __init__(self):
     xml = SimpleXML(Path.executeDirectory())
     try:
         self.__lngSect = xml.openSection(SysConfig().lngFile)
     except Exception, err:
         raise err