コード例 #1
0
    def __loadConfiguration(self, configPath, **kwargs):
        # load the base config
        baseConfig = path.dirname(__file__) + "\config.ini"
        self.__config = Config()
        if path.exists(baseConfig):
            self.__config.read(baseConfig)
        else:
            raise FileNotFoundError("No base config file")

        # check the config path
        if configPath is not None:
            if path.exists(configPath):
                self.__config.read(configPath)
            else:
                raise FileNotFoundError("specified config not found")
コード例 #2
0
ファイル: TpFactory.py プロジェクト: wangcunqiang/python-uds
    def loadConfiguration(configPath=None):

        #load the base config
        baseConfig = path.dirname(__file__) + "/config.ini"
        config = Config()
        if path.exists(baseConfig):
            config.read(baseConfig)
        else:
            raise FileNotFoundError("No base config file")

        # check the config path
        if configPath is not None:
            if path.exists(configPath):
                config.read(configPath)
            else:
                raise FileNotFoundError("specified config not found")

        TpFactory.config = config