コード例 #1
0
 def _lock_state_file(self):
     if not self.lock:
         return
     self._lockfile = lockfile.LockFile(self.path)
     try:
         self._lockfile.acquire()
     except IOError:
         raise exception.HomeDirPermissionsError(dirname(self.path))
コード例 #2
0
    def _lock_dbindex(self):
        if not self.cache_dir:
            os.makedirs(self.cache_dir)
        self._lockfile = lockfile.LockFile(self.cache_dir)
        try:
            self._lockfile.acquire()
        except:  # pylint: disable=bare-except
            return False

        return True