def doPreDocumentLoadComplete(obj): focusObject=api.getFocusObject() if (not obj.treeInterceptor or not obj.treeInterceptor.isAlive or obj.treeInterceptor.shouldPrepare) and (obj==focusObject or obj in api.getFocusAncestors()): ti=treeInterceptorHandler.update(obj) if ti: obj.treeInterceptor=ti #Focus may be in this new treeInterceptor, so force focus to look up its treeInterceptor focusObject.treeInterceptor=treeInterceptorHandler.getTreeInterceptor(focusObject) return True
def _get_treeInterceptor(self): """Retreaves the treeInterceptor associated with this object. If a treeInterceptor has not been specifically set, the L{treeInterceptorHandler} is asked if it can find a treeInterceptor containing this object. @return: the treeInterceptor @rtype: L{treeInterceptorHandler.TreeInterceptor} """ if hasattr(self,'_treeInterceptor'): ti=self._treeInterceptor if isinstance(ti,weakref.ref): ti=ti() if ti and ti in treeInterceptorHandler.runningTable: return ti else: self._treeInterceptor=None return None else: ti=treeInterceptorHandler.getTreeInterceptor(self) if ti: self._treeInterceptor=weakref.ref(ti) return ti