def reset_interface(self): self.namespaces = odict() self.classes = {} self.imports = {} self.nsmap = dict(rpclib.const.xml_ns.const_nsmap) self.prefmap = dict(rpclib.const.xml_ns.const_prefmap) self.nsmap['tns'] = self.get_tns() self.prefmap[self.get_tns()] = 'tns'
def etree_to_dict(element, iterable=(list, list.append)): if (element.text is None) or element.text.isspace(): retval = odict() for elt in element: if not (elt.tag in retval): retval[elt.tag] = iterable[0]() iterable[1](retval[elt.tag], etree_to_dict(elt, iterable)) else: retval = element.text return retval
def etree_to_dict(element, iterable=(list,list.append)): if (element.text is None) or element.text.isspace(): retval = odict() for elt in element: if not (elt.tag in retval): retval[elt.tag] = iterable[0]() iterable[1](retval[elt.tag], etree_to_dict(elt, iterable)) else: retval = element.text return retval
def etree_to_dict(element, iterable=(list, list.append)): """Takes an xml root element and returns the corresponding dict. The second argument is a pair of iterable type and the function used to add elements to the iterable. The xml attributes are ignored. """ if (element.text is None) or element.text.isspace(): retval = odict() for elt in element: if not (elt.tag in retval): retval[elt.tag] = iterable[0]() iterable[1](retval[elt.tag], etree_to_dict(elt, iterable)) else: retval = element.text return retval
def __init__(self, parent, services, tns, name=None): self.__ns_counter = 0 self.parent = parent self.services = services self.__tns = tns self.__name = name self.call_routes = {} self.namespaces = odict() self.classes = {} self.imports = {} self.nsmap = dict(rpclib.const_nsmap) self.prefmap = dict(rpclib.const_prefmap) self.nsmap['tns'] = tns self.prefmap[tns] = 'tns' self.populate_interface()
def __init__(self, parent, services, tns, name=None): self.__ns_counter = 0 self.parent = parent self.services = services self.__tns = tns self.__name = name self.call_routes = {} self.namespaces = odict() self.classes = {} self.imports = {} self.nsmap = dict(rpclib.const_nsmap) self.prefmap = dict(rpclib.const_prefmap) self.nsmap['tns']=tns self.prefmap[tns]='tns' self.populate_interface()
def __init__(self, parent, services, tns, name=None, import_base_namespaces=False): self.__ns_counter = 0 # FIXME: this belongs in the wsdl class self.import_base_namespaces = import_base_namespaces self.parent = parent self.services = services self.__tns = tns self.__name = name self.url = None self.call_routes = {} self.namespaces = odict() self.classes = {} self.imports = {} self.nsmap = dict(rpclib.const.xml_ns.const_nsmap) self.prefmap = dict(rpclib.const.xml_ns.const_prefmap) self.nsmap['tns']=tns self.prefmap[tns]='tns' self.populate_interface()
def __init__(self): self.elements = odict() self.types = odict()
def __init__(self, interface): InterfaceDocumentBase.__init__(self, interface) self.schema_dict = {} self.validation_schema = None self.namespaces = odict()