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

Method append

suds/sax/element.py:311–333  ·  view source on GitHub ↗

Append the specified child based on whether it is an element or an attrbuite. @param objects: A (single|collection) of attribute(s) or element(s) to be added as children. @type objects: (L{Element}|L{Attribute}) @return: self @rtype: L{Ele

(self, objects)

Source from the content-addressed store, hash-verified

309 return Namespace.default
310
311 def append(self, objects):
312 """
313 Append the specified child based on whether it is an
314 element or an attrbuite.
315 @param objects: A (single|collection) of attribute(s) or element(s)
316 to be added as children.
317 @type objects: (L{Element}|L{Attribute})
318 @return: self
319 @rtype: L{Element}
320 """
321 if not isinstance(objects, (list, tuple)):
322 objects = (objects,)
323 for child in objects:
324 if isinstance(child, Element):
325 self.children.append(child)
326 child.parent = self
327 continue
328 if isinstance(child, Attribute):
329 self.attributes.append(child)
330 child.parent = self
331 continue
332 raise Exception('append %s not-valid' % child.__class__.__name__)
333 return self
334
335 def insert(self, objects, index=0):
336 """

Callers 15

runMethod · 0.95
xmlMethod · 0.95
xmlMethod · 0.95
xmlMethod · 0.95
cloneMethod · 0.95
setMethod · 0.95
startElementMethod · 0.95
envelopeMethod · 0.95
headerMethod · 0.95
bodyMethod · 0.95
__repr__Method · 0.45
findPrefixesMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected