def _get_id_from_dirpath(self, dirpath): """ Internal - method for discovering the pairtree identifier for a given directory path. E.g. pairtree_root/fo/ob/ar/+/ --> 'foobar:' @param dirpath: Directory path to decode @type dirpath: Path to object's root @returns: Decoded identifier """ #path = self._get_path_from_dirpath(dirpath) #return self.id_decode("".join(path)) return ppath.get_id_from_dirpath(dirpath, self.pairtree_root)
def path2id(path): """ pass in a pairtree path and get back an id """ return ppath.get_id_from_dirpath(path)