def close(self): s = string.lstrip(self.data) if s[:7] == '<value>': self.value = _xmlrpc.decode(data) elif ((s[:21] == "<?xml version='1.0'?>") or (s[:21] == '<?xml version="1.0"?>')): s = string.lstrip(s[21:]) if s[:16] == '<methodResponse>': try: s = ("HTTP/1.0 200 OK\r\n" "Content-length: %d\r\n\r\n" "%s" % (len(self.data),self.data)) self.value = _xmlrpc.parseResponse(s)[0] except _xmlrpc.fault: v = sys.exc_value raise Fault(v.faultCode, v.faultString) elif s[:12] == '<methodCall>': (self.method, self.value) = _xmlrpc.parseCall(self.data) if self.value == None: raise TypeError, "unrecognized data: %.40s..." % s return self.value
def close(self): s = string.lstrip(self.data) if s[:7] == '<value>': self.value = _xmlrpc.decode(data) elif s[:14] == "<?xml version=": i = string.find(s, '?>') if i < 0: raise TypeError("unrecognized data: %.40s..." % s) s = string.lstrip(s[i + 2:]) if s[:16] == '<methodResponse>': try: s = ("HTTP/1.0 200 OK\r\n" "Content-length: %d\r\n\r\n" "%s" % (len(self.data), self.data)) self.value = _xmlrpc.parseResponse(s)[0] except _xmlrpc.fault: v = sys.exc_value raise Fault(v.faultCode, v.faultString) elif s[:12] == '<methodCall>': (self.method, self.value) = _xmlrpc.parseCall(self.data) if self.value == None: raise TypeError("unrecognized data: %.40s..." % s) return self.value
def close(self): log.debug("funcs", "Unmarshaller.close() Super fast XML!") s = string.lstrip(self.data) if s[:7] == '<value>': self.value = _xmlrpc.decode(data) elif ((s[:19] == "<?xml version='1.0'") or (s[:19] == '<?xml version="1.0"')): s = string.lstrip(s[s.index("?>")+3:]) if s[:16] == '<methodResponse>': try: s = ("HTTP/1.0 200 OK\r\n" "Content-length: %d\r\n\r\n" "%s" % (len(self.data),self.data)) self.value = (_xmlrpc.parseResponse(s)[0], ) except _xmlrpc.fault: v = sys.exc_value raise Fault(v.faultCode, v.faultString) elif s[:12] == '<methodCall>': (self.method, self.value) = _xmlrpc.parseCall(self.data) if self.value == None: raise TypeError, "unrecognized data: %.40s..." % s return self.value
def parseResponse(response): return _xmlrpc.parseResponse(response)