def workspace(self): # Attempt to acquire the current workspace if IWorkspaceFolder.providedBy(self.context): return self.context for parent in aq_chain(self.context): if IWorkspaceFolder.providedBy(parent): return parent
def parent_workspace(context): """ Return containing workspace Returns None if not found. """ if IWorkspaceFolder.providedBy(context): return context for parent in aq_chain(context): if IWorkspaceFolder.providedBy(parent): return parent
def in_workspace(context): return IWorkspaceFolder.providedBy(parent_workspace(context))