Example #1
0
 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)
Example #2
0
 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)
Example #3
0
 def __call__(self, toplevel, register):
     if not inside(self.context, toplevel):
         return self.context
     raise ResumeCopy
Example #4
0
 def _callFUT(self, i1, i2):
     from zope.location.location import inside
     return inside(i1, i2)
Example #5
0
 def __call__(self, toplevel, register):
     if not inside(self.context, toplevel):
         return self.context
     raise ResumeCopy
Example #6
0
 def _callFUT(self, i1, i2):
     from zope.location.location import inside
     return inside(i1, i2)