MCPcopy Create free account
hub / github.com/mhammond/pywin32 / GetCreateSubItem

Method GetCreateSubItem

com/win32comext/axscript/client/framework.py:342–356  ·  view source on GitHub ↗
(self, parentItem, name, dispatch, flags)

Source from the content-addressed store, hash-verified

340 return self.subItems[name.lower()]
341
342 def GetCreateSubItem(self, parentItem, name, dispatch, flags):
343 keyName = name.lower()
344 try:
345 rc = self.subItems[keyName]
346 # No changes allowed to existing flags.
347 if not rc.flags is None and not flags is None and rc.flags != flags:
348 raise Exception(scode=winerror.E_INVALIDARG)
349 # Existing item must not have a dispatch.
350 if not rc.dispatch is None and not dispatch is None:
351 raise Exception(scode=winerror.E_INVALIDARG)
352 rc.flags = flags # Setup the real flags.
353 rc.dispatch = dispatch
354 except KeyError:
355 rc = self.subItems[keyName] = self.GetSubItemClass()(parentItem, name, dispatch, flags)
356 return rc
357# if self.dispatch is None:
358# RaiseAssert(winerror.E_UNEXPECTED, "??")
359

Callers 2

DoAddScriptletMethod · 0.80

Calls 2

GetSubItemClassMethod · 0.95
ExceptionClass · 0.85

Tested by

no test coverage detected