def static_init(cls): # init storage lock folder = os.path.expanduser( cls.configuration.get("storage", "filesystem_folder")) cls._makedirs_synced(folder) lock_path = os.path.join(folder, ".Radicale.lock") cls._lock = pathutils.RwLock(lock_path)
def _acquire_cache_lock(self, ns=""): if self._storage._lock.locked == "w": return contextlib.ExitStack() cache_folder = os.path.join(self._filesystem_path, ".Radicale.cache") self._storage._makedirs_synced(cache_folder) lock_path = os.path.join(cache_folder, ".Radicale.lock" + (".%s" % ns if ns else "")) lock = pathutils.RwLock(lock_path) return lock.acquire("w")
def __init__(self, configuration): super().__init__(configuration) folder = self.configuration.get("storage", "filesystem_folder") lock_path = os.path.join(folder, ".Radicale.lock") self._lock = pathutils.RwLock(lock_path)
def __init__(self): self._file = tempfile.NamedTemporaryFile() self._lock = pathutils.RwLock(self._file.name) self._cm = None
def static_init(cls): super().static_init() folder = os.path.expanduser( cls.configuration.get("storage", "filesystem_folder")) lock_path = os.path.join(folder, ".Radicale.lock") cls._lock = pathutils.RwLock(lock_path)