def get_path(self, node=None, relative=True): if node is None: node = self.node elif node is not None and relative: node = os.path.join(self.node, clear_start_path(node)) elif node is not None and not relative: pass else: raise ProgrammingError node = clear_start_path(node) path = os.path.join(self.get_root(), node) if not path.startswith(self.get_root()): raise SecurityError return path
def get_relative_path(self, node): return clear_start_path(os.path.join(self.node, clear_start_path(node)))