def getparser(use_datetime=0):
 if (use_datetime and (not datetime)):
  raise ValueError, 'the datetime module is not available'
 if (FastParser and FastUnmarshaller):
  if use_datetime:
   mkdatetime = _datetime_type
  else:
   mkdatetime = _datetime
  target = FastUnmarshaller(True, False, _binary, mkdatetime, Fault)
  parser = FastParser(target)
 else:
  target = Unmarshaller(use_datetime=use_datetime)
  if FastParser:
   parser = FastParser(target)
  elif ExpatParser:
   parser = ExpatParser(target)
  else:
   parser = SlowParser(target)
 return (parser, target)

def getparser ( use_datetime = 0 ) : if ( use_datetime and ( not datetime ) ) : raise ValueError , 'the datetime module is not available' if ( FastParser and FastUnmarshaller ) : if use_datetime : mkdatetime = _datetime_type else : mkdatetime = _datetime target = FastUnmarshaller ( True , False , _binary , mkdatetime , Fault ) parser = FastParser ( target ) else : target = Unmarshaller ( use_datetime = use_datetime ) if FastParser : parser = FastParser ( target ) elif ExpatParser : parser = ExpatParser ( target ) else : parser = SlowParser ( target ) return ( parser , target )
getparser() -> parser .