@allow_from_sudo()
    def unlock(self):
        """Unlock the application directory for exclusive write access."""
        if self.sudo_proxy is not None:
            return self.sudo_proxy.unlock()
        self._lock_count -= 1
        if self._lock_count == 0:
            if threading:
                curthread = threading.currentThread()
                try:
                    threadid = curthread.ident
                except __HOLE__:
                    threadid = curthread.getName()
            else:
                threadid = "0"
            myid = "%s-%s-%s" % (socket.gethostname(), os.getpid(), threadid)
            lockdir = os.path.join(self.appdir, "locked")
            os.unlink(os.path.join(lockdir, myid))
            os.rmdir(lockdir)
dataset/ETHPy150Open cloudmatrix/esky/esky/__init__.py/Esky.unlock