def find_next_sitemanager(site): """Find the closest sitemanager that is not the specified site's sitemanager. """ while True: site = get_parent(site, default=None) if site is None: return None if ISite.providedBy(site): return site.getSiteManager()
def findNextSite(container): """Return the next site. """ while container: if IContainmentRoot.providedBy(container): return None try: container = get_parent(container) if container is None: return None except TypeError: return None if ISite.providedBy(container): return container
def find_next_sitemanager(site): """Find the closest sitemanager that is not the specified site's sitemanager. """ container = site sm = None while sm is None: if IContainmentRoot.providedBy(container): # We are at the root site, return None return None try: container = get_parent(container) if container is None: return None except TypeError: # There was not enough context; probably run from a test return None if ISite.providedBy(container): sm = container.getSiteManager() return sm
def _recurse_to_site(current, wanted): if not Acquisition.aq_base(current) == wanted: current = _recurse_to_site(get_parent(current), wanted) return current