wpiformat/wpiformat/config.py
def __parse_config_file(self, directory, file_name):
        """Parse values from config file.

        Checks current directory for config file. If one doesn't exist, try all
        parent directories as well.

        Keyword arguments:
        directory -- current directory from which to start search
        file_name -- config file name string

        Returns dictionary of groups (group name -> list of values).
        """
        in_group = False
        config_group = {}
        group_name = ""
        group_elements = []

        self.file_name, lines = self.read_file(directory, file_name)
        if not lines:
            return None

        for line in lines:
            # Skip empty lines
            if line.strip() == "":
                continue

            if "{" in line:
                in_group = True

                # Group name is on same line as "{"
                group_name = line[:line.find("{")].strip()
            elif "}" in line:
                in_group = False

                # After group closes, save element list and clear it
                config_group[group_name] = group_elements
                group_elements = []
            elif in_group:
                value = line.strip()

                # Header includes still use forward slash on Windows
                unescaped_groups = [
                    "includeRelated", "includeCSys", "includeCppSys",
                    "includeOtherLibs", "includeProject"
                ]
                if group_name == "includeGuardRoots":
                    # Include guard roots use native directory separators
                    value = value.replace("/", os.sep)
                elif group_name not in unescaped_groups and os.sep == "\\":
                    # Replace "/" with escaped "\" for regexes on Windows
                    value = value.replace("/", os.sep + os.sep)

                group_elements.append(value)
        return config_group
Parse values from config file.

        Checks current directory for config file. If one doesn't exist, try all
        parent directories as well.

        Keyword arguments:
        directory -- current directory from which to start search
        file_name -- config file name string

        Returns dictionary of groups (group name -> list of values).
        
Parse values from config file.
Checks current directory for config file. If one doesn't exist, try all
parent directories as well.

Keyword arguments:
directory -- current directory from which to start search
file_name -- config file name string

Returns dictionary of groups (group name -> list of values).
Parse values from config file . Checks current directory for config file . If one doesn ' t exist try all parent directories as well . Keyword arguments : directory -- current directory from which to start search file_name -- config file name string Returns dictionary of groups ( group name - > list of values ) .
def __parse_config_file(self, directory, file_name):
        in_group = False
        config_group = {}
        group_name = ""
        group_elements = []
        self.file_name, lines = self.read_file(directory, file_name)
        if not lines:
            return None
        for line in lines:
            if line.strip() == "":
                continue
            if "{" in line:
                in_group = True
                group_name = line[:line.find("{")].strip()
            elif "}" in line:
                in_group = False
                config_group[group_name] = group_elements
                group_elements = []
            elif in_group:
                value = line.strip()
                unescaped_groups = [
                    "includeRelated", "includeCSys", "includeCppSys",
                    "includeOtherLibs", "includeProject"
                ]
                if group_name == "includeGuardRoots":
                    value = value.replace("/", os.sep)
                elif group_name not in unescaped_groups and os.sep == "\\":
                    value = value.replace("/", os.sep + os.sep)
                group_elements.append(value)
        return config_group
def __parse_config_file ( self , directory , file_name ) : in_group = False config_group = { } group_name = "" group_elements = [ ] self . file_name , lines = self . read_file ( directory , file_name ) if not lines : return None for line in lines : if line . strip ( ) == "" : continue if "{" in line : in_group = True group_name = line [ : line . find ( "{" ) ] . strip ( ) elif "}" in line : in_group = False config_group [ group_name ] = group_elements group_elements = [ ] elif in_group : value = line . strip ( ) unescaped_groups = [ "includeRelated" , "includeCSys" , "includeCppSys" , "includeOtherLibs" , "includeProject" ] if group_name == "includeGuardRoots" : value = value . replace ( "/" , os . sep ) elif group_name not in unescaped_groups and os . sep == "\\" : value = value . replace ( "/" , os . sep + os . sep ) group_elements . append ( value ) return config_group
Parse values from config file.
Parse values from config file .
"""Parse values from config file.

        Checks current directory for config file. If one doesn't exist, try all
        parent directories as well.

        Keyword arguments:
        directory -- current directory from which to start search
        file_name -- config file name string

        Returns dictionary of groups (group name -> list of values).
        """ # Skip empty lines # Group name is on same line as "{" # After group closes, save element list and clear it # Header includes still use forward slash on Windows # Include guard roots use native directory separators # Replace "/" with escaped "\" for regexes on Windows
self
directory
file_name