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

Method findattr

suds/resolver.py:350–371  ·  view source on GitHub ↗

Find an attribute type definition. @param name: An attribute name. @type name: basestring @param resolved: A flag indicating that the fully resolved type should be returned. @type resolved: boolean @return: The found schema I{type}

(self, name, resolved=True)

Source from the content-addressed store, hash-verified

348 return result
349
350 def findattr(self, name, resolved=True):
351 """
352 Find an attribute type definition.
353 @param name: An attribute name.
354 @type name: basestring
355 @param resolved: A flag indicating that the fully resolved type should
356 be returned.
357 @type resolved: boolean
358 @return: The found schema I{type}
359 @rtype: L{xsd.sxbase.SchemaObject}
360 """
361 name = '@%s' % name
362 parent = self.top().resolved
363 if parent is None:
364 result, ancestry = self.query(name, node)
365 else:
366 result, ancestry = self.getchild(name, parent)
367 if result is None:
368 return result
369 if resolved:
370 result = result.resolve()
371 return result
372
373 def query(self, name, node):
374 """ blindly query the schema by name """

Callers 1

append_attributeMethod · 0.80

Calls 4

queryMethod · 0.95
getchildMethod · 0.80
topMethod · 0.45
resolveMethod · 0.45

Tested by

no test coverage detected