def _parse_mongodb_databases_kv(line, out, prefix=None, force_type=None, value_name=None):
 try:
  (key, value) = line.split(' =', 1)
  value = value[1:]
 except ValueError:
  sys.stderr.write(('WARNING: unknown keyword %r\r\n' % line))
  return
 if (key == '$err'):
  key = 'errmsg'
 if (prefix is not None):
  key = ('%s_%s' % (prefix, key))
 if (force_type is not None):
  value = force_type(value)
 else:
  value = _MONGODB_DATABASES_TYPES.get(key, (lambda x: x))(value)
 if isinstance(out, dict):
  assert (key not in out)
  out[key] = value
 elif isinstance(out, list):
  out.append({'name': key, value_name: value})

def _parse_mongodb_databases_kv ( line , out , prefix = None , force_type = None , value_name = None ) : try : ( key , value ) = line . split ( ' =' , 1 ) value = value [ 1 : ] except ValueError : sys . stderr . write ( ( 'WARNING: unknown keyword %r\r\n' % line ) ) return if ( key == '$err' ) : key = 'errmsg' if ( prefix is not None ) : key = ( '%s_%s' % ( prefix , key ) ) if ( force_type is not None ) : value = force_type ( value ) else : value = _MONGODB_DATABASES_TYPES . get ( key , ( lambda x : x ) ) ( value ) if isinstance ( out , dict ) : assert ( key not in out ) out [ key ] = value elif isinstance ( out , list ) : out . append ( { 'name' : key , value_name : value } )
parse key = value lines from mongodb-databases output .