def set_main(key, value, path=MAIN_CF):
 (pairs, conf_list) = _parse_main(path)
 new_conf = []
 if (key in pairs):
  for line in conf_list:
   if line.startswith(key):
    new_conf.append('{0} = {1}'.format(key, value))
   else:
    new_conf.append(line)
 else:
  conf_list.append('{0} = {1}'.format(key, value))
  new_conf = conf_list
 _write_conf(new_conf, path)
 return new_conf

def set_main ( key , value , path = MAIN_CF ) : ( pairs , conf_list ) = _parse_main ( path ) new_conf = [ ] if ( key in pairs ) : for line in conf_list : if line . startswith ( key ) : new_conf . append ( '{0} = {1}' . format ( key , value ) ) else : new_conf . append ( line ) else : conf_list . append ( '{0} = {1}' . format ( key , value ) ) new_conf = conf_list _write_conf ( new_conf , path ) return new_conf
set a single config value in the main .