def __init__(self, directoryPath):
        """
        Load all configuration files at a given path.

        :param directoryPath: <str> path to load
        """
        self._data = {}

        configFiles = os.listdir(directoryPath)
        configFilesPendingLoading = []

        # loading global and *.global.json files
        if "global.json" in configFiles:
            configFilesPendingLoading.append(
                os.path.join(directoryPath, "global.json")
            )
        for configFile in configFiles:
            if configFile.endswith(".global.json"):
                configFilesPendingLoading.append(
                    os.path.join(directoryPath, configFile)
                )

        # loading local and *.local.json files
        if "local.json" in configFiles:
            configFilesPendingLoading.append(
                os.path.join(directoryPath, "local.json")
            )
        for configFile in configFiles:
            if configFile.endswith(".local.json"):
                configFilesPendingLoading.append(
                    os.path.join(directoryPath, configFile)
                )

        # loading remaining config files
        for configFile in configFiles:
            if configFile.endswith(".config.json"):
                configFilesPendingLoading.append(
                    os.path.join(directoryPath, configFile)
                )

        for configFilePath in configFilesPendingLoading:
            configFile = open(configFilePath, "r")
            Config.mergeDictionaries(json.load(configFile), self._data)
def __init__ ( self , directoryPath ) : self . _data = { } configFiles = os . listdir ( directoryPath ) configFilesPendingLoading = [ ] if "global.json" in configFiles : configFilesPendingLoading . append ( os . path . join ( directoryPath , "global.json" ) ) for configFile in configFiles : if configFile . endswith ( ".global.json" ) : configFilesPendingLoading . append ( os . path . join ( directoryPath , configFile ) ) if "local.json" in configFiles : configFilesPendingLoading . append ( os . path . join ( directoryPath , "local.json" ) ) for configFile in configFiles : if configFile . endswith ( ".local.json" ) : configFilesPendingLoading . append ( os . path . join ( directoryPath , configFile ) ) for configFile in configFiles : if configFile . endswith ( ".config.json" ) : configFilesPendingLoading . append ( os . path . join ( directoryPath , configFile ) ) for configFilePath in configFilesPendingLoading : configFile = open ( configFilePath , "r" ) Config . mergeDictionaries ( json . load ( configFile ) , self . _data )
Load all configuration files at a given path.

        :param directoryPath: <str> path to load