def input_string_or_dict(options, allow_multiples=True):
 if (options == '<<inherit>>'):
  options = {}
 if ((options is None) or (options == 'delete')):
  return (True, {})
 elif isinstance(options, list):
  raise CX((_('No idea what to do with list: %s') % options))
 elif isinstance(options, basestring):
  new_dict = {}
  tokens = shlex.split(options)
  for t in tokens:
   tokens2 = t.split('=', 1)
   if (len(tokens2) == 1):
    key = tokens2[0]
    value = None
   else:
    key = tokens2[0]
    value = tokens2[1]
   if ((key in new_dict.keys()) and allow_multiples):
    if isinstance(new_dict[key], list):
     new_dict[key].append(value)
    else:
     new_dict[key] = [new_dict[key], value]
   else:
    new_dict[key] = value
  new_dict.pop('', None)
  return (True, new_dict)
 elif isinstance(options, dict):
  options.pop('', None)
  return (True, options)
 else:
  raise CX(_('invalid input type'))

def input_string_or_dict ( options , allow_multiples = True ) : if ( options == '<<inherit>>' ) : options = { } if ( ( options is None ) or ( options == 'delete' ) ) : return ( True , { } ) elif isinstance ( options , list ) : raise CX ( ( _ ( 'No idea what to do with list: %s' ) % options ) ) elif isinstance ( options , basestring ) : new_dict = { } tokens = shlex . split ( options ) for t in tokens : tokens2 = t . split ( '=' , 1 ) if ( len ( tokens2 ) == 1 ) : key = tokens2 [ 0 ] value = None else : key = tokens2 [ 0 ] value = tokens2 [ 1 ] if ( ( key in new_dict . keys ( ) ) and allow_multiples ) : if isinstance ( new_dict [ key ] , list ) : new_dict [ key ] . append ( value ) else : new_dict [ key ] = [ new_dict [ key ] , value ] else : new_dict [ key ] = value new_dict . pop ( '' , None ) return ( True , new_dict ) elif isinstance ( options , dict ) : options . pop ( '' , None ) return ( True , options ) else : raise CX ( _ ( 'invalid input type' ) )
older cobbler files stored configurations in a flat way .