def getparser(self): ''' TBD ''' unmarshaller = ExceptionUnmarshaller() parser = xmlrpclib.ExpatParser(unmarshaller) return parser, unmarshaller
def getparser(use_datetime=0): """getparser() -> parser, unmarshaller (derived from python's xmlrpclib) Create an instance of the fastest available parser, and attach it to an Unmarshalling object. Return both objects. """ if use_datetime and not _pyxmlrpc.datetime: raise ValueError, "the datetime module is not available" target = Unmarshaller(use_datetime=use_datetime) if _pyxmlrpc.FastParser: parser = _pyxmlrpc.FastParser(target) elif _pyxmlrpc.SgmlopParser: parser = _pyxmlrpc.SgmlopParser(target) elif _pyxmlrpc.ExpatParser: parser = _pyxmlrpc.ExpatParser(target) else: parser = _pyxmlrpc.SlowParser(target) return parser, target
def _GetParser(self, target): """Return fastest available parser and unmarshalling object. This logic is copied from xmlrpclib.Transport.getparser() but allows supplying a target (the Unmarshalling object). Args: target: Unmarshaller object instance Returns: parser, target = xml parser, Unmarshaller objects """ if xmlrpclib.FastParser: parser = xmlrpclib.FastParser(target) elif xmlrpclib.SgmlopParser: parser = xmlrpclib.SgmlopParser(target) elif xmlrpclib.ExpatParser: parser = xmlrpclib.ExpatParser(target) else: parser = xmlrpclib.SlowParser(target) return parser, target
def getparser (self): # We want to use our own custom unmarshaller unmarshaller = ExceptionUnmarshaller() parser = xmlrpclib.ExpatParser(unmarshaller) return parser, unmarshaller
def getparser(self): """We want to use our own custom unmarshaller""" unmarshaller = XMLRPCUnmarshaller() parser = xmlrpclib.ExpatParser(unmarshaller) return parser, unmarshaller