MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / replace_references

Method replace_references

suds/bindings/multiref.py:72–93  ·  view source on GitHub ↗

Replacing the I{multiref} references with the contents of the referenced nodes and remove the I{href} attribute. Warning: since the I{ref} is not cloned, @param node: A node to update. @type node: L{Element}

(self, node)

Source from the content-addressed store, hash-verified

70 return node
71
72 def replace_references(self, node):
73 """
74 Replacing the I{multiref} references with the contents of the
75 referenced nodes and remove the I{href} attribute. Warning: since
76 the I{ref} is not cloned,
77 @param node: A node to update.
78 @type node: L{Element}
79 """
80 href = node.getAttribute('href')
81 if href is None:
82 return
83 id = href.getValue()
84 ref = self.catalog.get(id)
85 if ref is None:
86 log.error('soap multiref: %s, not-resolved', id)
87 return
88 node.append(ref.children)
89 node.setText(ref.getText())
90 for a in ref.attributes:
91 if a.name != 'id':
92 node.append(a)
93 node.remove(href)
94
95 def build_catalog(self, body):
96 """

Callers 1

updateMethod · 0.95

Calls 7

getAttributeMethod · 0.80
getValueMethod · 0.80
setTextMethod · 0.80
getTextMethod · 0.80
removeMethod · 0.80
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected