ensemble_hic/setup_functions.py
def parse_config_file(config_file):
    """
    Parses a config file consisting of several sections.
    I think I adapted this from the ConfigParser docs.

    :param config_file: config file name
    :type config_file: str

    :returns: a nested dictionary with sections and section content
    :rtype: dict of dicts
    """
    import ConfigParser

    config = ConfigParser.ConfigParser()
    config.read(config_file)
    
    def config_section_map(section):
        dict1 = {}
        options = config.options(section)
        for option in options:
            try:
                dict1[option] = config.get(section, option)
            except:
                dict1[option] = None
        return dict1

    return {section: config_section_map(section) for section in config.sections()}

    Parses a config file consisting of several sections.
    I think I adapted this from the ConfigParser docs.

    :param config_file: config file name
    :type config_file: str

    :returns: a nested dictionary with sections and section content
    :rtype: dict of dicts
    
Parses a config file consisting of several sections.
I think I adapted this from the ConfigParser docs.
Parses a config file consisting of several sections . I think I adapted this from the ConfigParser docs .
def parse_config_file(config_file):
    import ConfigParser
    config = ConfigParser.ConfigParser()
    config.read(config_file)
    def config_section_map(section):
        dict1 = {}
        options = config.options(section)
        for option in options:
            try:
                dict1[option] = config.get(section, option)
            except:
                dict1[option] = None
        return dict1
    return {section: config_section_map(section) for section in config.sections()}
def parse_config_file ( config_file ) : import ConfigParser config = ConfigParser . ConfigParser ( ) config . read ( config_file ) def config_section_map ( section ) : dict1 = { } options = config . options ( section ) for option in options : try : dict1 [ option ] = config . get ( section , option ) except : dict1 [ option ] = None return dict1 return { section : config_section_map ( section ) for section in config . sections ( ) }
Parses a config file consisting of several sections.
Parses a config file consisting of several sections .
"""
    Parses a config file consisting of several sections.
    I think I adapted this from the ConfigParser docs.

    :param config_file: config file name
    :type config_file: str

    :returns: a nested dictionary with sections and section content
    :rtype: dict of dicts
    """
a nested dictionary with sections and section content
a nested dictionary with sections and section content
dict of dicts
config_file
config file name
config file name