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

def config_section_map ( config_file , section ) : config = ConfigParser . ConfigParser ( ) config . read ( config_file ) dict1 = { } if ( section not in config . sections ( ) ) : return dict1 options = config . options ( section ) for option in options : try : dict1 [ option ] = config . get ( section , option ) except : dict1 [ option ] = None return dict1
map the values of a config file to a dictionary .