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

Method getprefix

suds/servicedefinition.py:172–186  ·  view source on GitHub ↗

Get the prefix for the specified namespace (uri) @param u: A namespace uri. @type u: str @return: The namspace. @rtype: (prefix, uri).

(self, u)

Source from the content-addressed store, hash-verified

170 raise Exception('prefixes exhausted')
171
172 def getprefix(self, u):
173 """
174 Get the prefix for the specified namespace (uri)
175 @param u: A namespace uri.
176 @type u: str
177 @return: The namspace.
178 @rtype: (prefix, uri).
179 """
180 for ns in Namespace.all:
181 if u == ns[1]:
182 return ns[0]
183 for ns in self.prefixes:
184 if u == ns[1]:
185 return ns[0]
186 raise Exception('ns (%s) not mapped' % u)
187
188 def xlate(self, type):
189 """

Callers 1

xlateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected