

def componentDetachedFromContainer(self, event):
    self._test._detachCounter += 1
    self._test._detachedComponent = event.getDetachedComponent()
    self._test._detachedTarget = event.getContainer()
    it = self._test._detachedTarget.getComponentIterator()
    while True:
        try:
            if (it.next() == event._test._detachedComponent):
                self._test._foundInContainer = True
                break
        except StopIteration:
            break
    if isinstance(self._test._detachedTarget, AbstractOrderedLayout):
        self._test._indexOfComponent = self._test._detachedTarget.getComponentIndex(self._test._detachedComponent)
    elif isinstance(self._test._detachedTarget, GridLayout):
        self._test._componentArea = self._test._detachedTarget.getComponentArea(self._test._detachedComponent)
    elif isinstance(self._test._detachedTarget, AbsoluteLayout):
        self._test._componentPosition = self._test._detachedTarget.getPosition(self._test._detachedComponent)

dataset/ETHPy150Open rwl/muntjac/muntjac/test/server/components/component_attach_detach_listener_test.py MyDetachListener.componentDetachedFromContainer/VarMisuse@73/101 `self`->`event`