(self, parentItem, name, dispatch, flags)
| 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 |
no test coverage detected