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")
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