def _visitSublocations(self) : """Restricts the access to the objects that live within the nearest site if the catalog itself is locatable. """ locatable = IPhysicallyLocatable(self, None) if locatable is not None : uidutil = getUtility(IQreatureIntIds, context=self) site = locatable.getNearestSite() for uid in uidutil: obj = uidutil.getObject(uid) if location.inside(obj, site) : yield uid, obj else : uidutil = getUtility(IQreatureIntIds) for uid in uidutil: yield uid, uidutil.getObject(uid)
def _visitSublocations(self) : """Restricts the access to the objects that live within the nearest site if the catalog itself is locatable. """ uidutil = None locatable = ILocationInfo(self, None) if locatable is not None : site = locatable.getNearestSite() sm = site.getSiteManager() uidutil = sm.queryUtility(IIntIds) if uidutil not in [c.component for c in sm.registeredUtilities()]: # we do not have a local inits utility uidutil = component.getUtility(IIntIds, context=self) for uid in uidutil: obj = uidutil.getObject(uid) if location.inside(obj, site) : yield uid, obj return if uidutil is None: uidutil = component.getUtility(IIntIds) for uid in uidutil: yield uid, uidutil.getObject(uid)
def __call__(self, toplevel, register): if not inside(self.context, toplevel): return self.context raise ResumeCopy
def _callFUT(self, i1, i2): from zope.location.location import inside return inside(i1, i2)