def parse_kconfig(data):
 config = {}
 NOT_SET = ' is not set'
 if (not data):
  return
 for line in data.splitlines():
  if (NOT_SET in line):
   line = line.split(NOT_SET, 1)[0]
   name = line.strip('# ')
   config[name] = None
  if ('=' in line):
   (k, v) = line.split('=', 1)
   if (v == 'y'):
    v = True
   elif (v == 'n'):
    v = False
   else:
    try:
     v = int(v, 0)
    except ValueError:
     pass
   config[k] = v
 config = {k.replace('CONFIG_', ''): v for (k, v) in config.items()}
 return config

def parse_kconfig ( data ) : config = { } NOT_SET = ' is not set' if ( not data ) : return for line in data . splitlines ( ) : if ( NOT_SET in line ) : line = line . split ( NOT_SET , 1 ) [ 0 ] name = line . strip ( '# ' ) config [ name ] = None if ( '=' in line ) : ( k , v ) = line . split ( '=' , 1 ) if ( v == 'y' ) : v = True elif ( v == 'n' ) : v = False else : try : v = int ( v , 0 ) except ValueError : pass config [ k ] = v config = { k . replace ( 'CONFIG_' , '' ) : v for ( k , v ) in config . items ( ) } return config
parses configuration data from a kernel .