MCPcopy Index your code
hub / github.com/ronreiter/interactive-tutorials / create

Method create

suds/client.py:239–264  ·  view source on GitHub ↗

create a WSDL type by name @param name: The name of a type defined in the WSDL. @type name: str @return: The requested object. @rtype: L{Object}

(self, name)

Source from the content-addressed store, hash-verified

237 self.builder = Builder(self.resolver)
238
239 def create(self, name):
240 """
241 create a WSDL type by name
242 @param name: The name of a type defined in the WSDL.
243 @type name: str
244 @return: The requested object.
245 @rtype: L{Object}
246 """
247 timer = metrics.Timer()
248 timer.start()
249 type = self.resolver.find(name)
250 if type is None:
251 raise TypeNotFound(name)
252 if type.enum():
253 result = InstFactory.object(name)
254 for e, a in type.children():
255 setattr(result, e.name, e.name)
256 else:
257 try:
258 result = self.builder.build(type)
259 except Exception as e:
260 log.error("create '%s' failed", name, exc_info=True)
261 raise BuildError(name, e)
262 timer.stop()
263 metrics.log.debug('%s created: %s', name, timer)
264 return result
265
266 def separator(self, ps):
267 """

Callers

nothing calls this directly

Calls 9

startMethod · 0.95
stopMethod · 0.95
TypeNotFoundClass · 0.90
BuildErrorClass · 0.90
objectMethod · 0.80
childrenMethod · 0.80
findMethod · 0.45
enumMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected