def parse_conf_files(conf_paths):
    """Parse the configuration file and return dictionary of configuration 
    options.
    
    @param conf_paths: List of configuration file paths to parse.
    @return:           Dictionary of configuration options.
    
    """
    conf_file = ConfigParser.RawConfigParser()
    conf_read = conf_file.read(conf_paths)
    conf = {}
    try:
        if conf_read:
            conf['client_id'] = conf_file.get('runkeeper', 'client_id')
            conf['client_secret'] = conf_file.get('runkeeper', 'client_secret')
            if conf_file.has_option('runkeeper', 'bindport'):
                conf['bindport'] = conf_file.getint('runkeeper', 'bindport')
            if conf_file.has_option('runkeeper', 'bindaddr'):
                conf['bindaddr'] = conf_file.get('runkeeper', 'bindaddr')
            if conf_file.has_option('runkeeper', 'baseurl'):
                conf['baseurl'] = conf_file.get('runkeeper', 'baseurl')
            return conf
    except ConfigParser.Error:
        raise ConfigurationError("Error parsing configuration file(s): %s\n" 
                                 % sys.exc_info()[1])
    else:
        raise ConfigurationError("No valid configuration file (%s) found." 
                                 % defaultConfFilename)
def parse_conf_files ( conf_paths ) : conf_file = ConfigParser . RawConfigParser ( ) conf_read = conf_file . read ( conf_paths ) conf = { } try : if conf_read : conf [ 'client_id' ] = conf_file . get ( 'runkeeper' , 'client_id' ) conf [ 'client_secret' ] = conf_file . get ( 'runkeeper' , 'client_secret' ) if conf_file . has_option ( 'runkeeper' , 'bindport' ) : conf [ 'bindport' ] = conf_file . getint ( 'runkeeper' , 'bindport' ) if conf_file . has_option ( 'runkeeper' , 'bindaddr' ) : conf [ 'bindaddr' ] = conf_file . get ( 'runkeeper' , 'bindaddr' ) if conf_file . has_option ( 'runkeeper' , 'baseurl' ) : conf [ 'baseurl' ] = conf_file . get ( 'runkeeper' , 'baseurl' ) return conf except ConfigParser . Error : raise ConfigurationError ( "Error parsing configuration file(s): %s\n" % sys . exc_info ( ) [ 1 ] ) else : raise ConfigurationError ( "No valid configuration file (%s) found." % defaultConfFilename )
Parse the configuration file and return dictionary of configuration 
    options.
    
    @param conf_paths: List of configuration file paths to parse.
    @return:           Dictionary of configuration options.