def parse_entry(entry_str, separator='='):
 entry = {}
 for line in entry_str.splitlines():
  if (len(line) == 0):
   continue
  try:
   (name, value) = line.split(separator, 1)
  except ValueError:
   continue
  name = name.strip()
  value = value.strip()
  if (name == 'index'):
   value = int(value)
  entry[name] = value
 return entry

def parse_entry ( entry_str , separator = '=' ) : entry = { } for line in entry_str . splitlines ( ) : if ( len ( line ) == 0 ) : continue try : ( name , value ) = line . split ( separator , 1 ) except ValueError : continue name = name . strip ( ) value = value . strip ( ) if ( name == 'index' ) : value = int ( value ) entry [ name ] = value return entry
parse entry as returned by boottool .