def extract(self, path, to_folder): if to_folder is not None: root = ReentrantFileLock(to_folder()) else: root = self.lock / "unzip" / __version__ with root.lock_for_key(path.name): dest = root.path / path.name if not dest.exists(): extract(path, dest) yield dest
def default_data_dir(): global _DATA_DIR if _DATA_DIR is None: folder = _get_default_data_folder() _DATA_DIR = ReentrantFileLock(folder) return _DATA_DIR
def __init__(self, folder): self.lock = ReentrantFileLock(folder)
def __init__(self, folder): self.folder = ReentrantFileLock(folder) self.transient = False