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

Method find

suds/resolver.py:91–118  ·  view source on GitHub ↗

Get the definition object for the schema type located at the specified path. The path may contain (.) dot notation to specify nested types. Actually, the path separator is usually a (.) but can be redefined during contruction. @param path: A (.) separ

(self, path, resolved=True)

Source from the content-addressed store, hash-verified

89 self.splitp = re.compile(r'({.+})*[^\%s]+' % ps[0])
90
91 def find(self, path, resolved=True):
92 """
93 Get the definition object for the schema type located at the specified
94 path.
95 The path may contain (.) dot notation to specify nested types.
96 Actually, the path separator is usually a (.) but can be redefined
97 during contruction.
98 @param path: A (.) separated path to a schema type.
99 @type path: basestring
100 @param resolved: A flag indicating that the fully resolved type
101 should be returned.
102 @type resolved: boolean
103 @return: The found schema I{type}
104 @rtype: L{xsd.sxbase.SchemaObject}
105 """
106 result = None
107 parts = self.split(path)
108 try:
109 result = self.root(parts)
110 if len(parts) > 1:
111 result = result.resolve(nobuiltin=True)
112 result = self.branch(result, parts)
113 result = self.leaf(result, parts)
114 if resolved:
115 result = result.resolve(nobuiltin=True)
116 except PathResolver.BadPath:
117 log.error('path: "%s", not-found' % path)
118 return result
119
120 def root(self, parts):
121 """

Callers

nothing calls this directly

Calls 5

splitMethod · 0.95
rootMethod · 0.95
branchMethod · 0.95
leafMethod · 0.95
resolveMethod · 0.45

Tested by

no test coverage detected