/usr/lib/python3/dist-packages/twisted/python/__pycache__
NameSizeModeActions
compat.cpython-310.pyc153980644editdlrm
components.cpython-310.pyc143640644editdlrm
constants.cpython-310.pyc4680644editdlrm
context.cpython-310.pyc46570644editdlrm
deprecate.cpython-310.pyc252210644editdlrm
failure.cpython-310.pyc189600644editdlrm
fakepwd.cpython-310.pyc72920644editdlrm
filepath.cpython-310.pyc520500644editdlrm
formmethod.cpython-310.pyc127170644editdlrm
htmlizer.cpython-310.pyc35820644editdlrm
lockfile.cpython-310.pyc51380644editdlrm
log.cpython-310.pyc230160644editdlrm
logfile.cpython-310.pyc104590644editdlrm
modules.cpython-310.pyc254690644editdlrm
monkey.cpython-310.pyc23150644editdlrm
procutils.cpython-310.pyc13890644editdlrm
randbytes.cpython-310.pyc37350644editdlrm
rebuild.cpython-310.pyc55780644editdlrm
reflect.cpython-310.pyc191270644editdlrm
release.cpython-310.pyc15250644editdlrm
roots.cpython-310.pyc89330644editdlrm
runtime.cpython-310.pyc56170644editdlrm
sendmsg.cpython-310.pyc25800644editdlrm
shortcut.cpython-310.pyc24640644editdlrm
syslog.cpython-310.pyc33680644editdlrm
systemd.cpython-310.pyc30510644editdlrm
text.cpython-310.pyc42690644editdlrm
threadable.cpython-310.pyc35200644editdlrm
threadpool.cpython-310.pyc105020644editdlrm
url.cpython-310.pyc2790644editdlrm
urlpath.cpython-310.pyc92820644editdlrm
usage.cpython-310.pyc286350644editdlrm
util.cpython-310.pyc279390644editdlrm
versions.cpython-310.pyc3560644editdlrm
win32.cpython-310.pyc48410644editdlrm
zippath.cpython-310.pyc91460644editdlrm
zipstream.cpython-310.pyc88260644editdlrm
_appdirs.cpython-310.pyc8620644editdlrm
_inotify.cpython-310.pyc25800644editdlrm
_pydoctor.cpython-310.pyc57500644editdlrm
_release.cpython-310.pyc181330644editdlrm
_shellcomp.cpython-310.pyc188550644editdlrm
_textattributes.cpython-310.pyc106420644editdlrm
_tzhelper.cpython-310.pyc33850644editdlrm
_url.cpython-310.pyc2690644editdlrm
__init__.cpython-310.pyc5460644editdlrm
Edit: /usr/lib/python3/dist-packages/twisted/python/__pycache__/lockfile.cpython-310.pyc (5138B)
o bZ@sdZddlZddlZddlmZddlmZddZddlmZe s3ddlm Z m Z m Z mZd Zn0d Zz ddlZdd lmZWn eyLdZ Yn wd Zd ZddZ eZddZddZ ddZ GdddZddZddgZdS)z& Filesystem-based interprocess mutex. N)time)platformcCstttdS)Ni)strint _uniquefloatrr9/usr/lib/python3/dist-packages/twisted/python/lockfile.pyuniquesr )rename)killreadlinkremovesymlinkFT) OpenProcessWc Csjz tdd|Wt dtjy4}z|jdtkr"WYd}~dS|jdtkr/ttjdd}~ww)Nrz OpenProcess is required to fail.) r pywintypeserrorargsERROR_ACCESS_DENIEDERROR_INVALID_PARAMETEROSErrorerrnoESRCH RuntimeError)pidsignalerrrr 4s r cCs|dtd}tj|d}t|d}t||}|||Wdn1s0wYzt||WdSt yOt |t |w)z Write a file at C{filename} with the contents of C{value}. See the above comment block as to why this is needed. .z.newlinkrwN) r ospathjoinmkdir_openwriteflushr BaseExceptionr rmdir)valuefilename newlinkname newvalnamemodefrrrrEs       rc Csz ttj|dd}Wnty+}z|jtjks |jtjkr&t|jdd}~ww| |}Wd|S1s>wY|S)zq Read the contents of C{filename}. See the above comment block as to why this is needed. rrN) r$r r!r"rrENOENTEIOread)r*fObjrresultrrrr `s   r cCs"ttj|dt|dS)Nr)r r r!r"r()r*rrrrmlinkrsr5c@s0eZdZdZdZdZddZddZdd ZdS) FilesystemLocka A mutex. This relies on the filesystem property that creating a symlink is an atomic operation and that it will fail if the symlink already exists. Deleting the symlink will release the lock. @ivar name: The name of the file associated with this lock. @ivar clean: Indicates whether this lock was released cleanly by its last owner. Only meaningful after C{lock} has been called and returns True. @ivar locked: Indicates whether the lock is currently held by this object. NFcCs ||_dS)N)name)selfr7rrr__init__s zFilesystemLock.__init__cCsd} z ttt|jWnty}ztr)|jtjtj fvr)WYd}~dS|jtj krzt |j}Wn2tyh}z&|jtj krOWYd}~WYd}~qtrc|jtjkrcWYd}~WYd}~dSd}~wwz t durut t|dWnKty}z?|jtjkrzt|jWn#ty}z|jtj krWYd}~WYd}~WYd}~qd}~wwd}WYd}~WYd}~qd}~wwWYd}~dSd}~wwd|_||_dS)z Acquire this lock. @rtype: C{bool} @return: True if the lock is acquired, false otherwise. @raise OSError: Any exception L{os.symlink()} may raise, other than L{errno.EEXIST}. TNFr)rrr getpidr7r_windowsrEACCESr1EEXISTr r0r rrr5lockedclean)r8r?rrrrrlocksX       +zFilesystemLock.lockcCs@t|j}t|tkrtd|jdt|jd|_dS)z Release this lock. This deletes the directory with the given name. @raise OSError: Any exception L{os.readlink()} may raise. @raise ValueError: If the lock is not owned by this process. zLock z not owned by this processFN)r r7rr r: ValueErrorr5r>)r8rrrrunlocks   zFilesystemLock.unlock) __name__ __module__ __qualname____doc__r?r>r9r@rBrrrrr6ws =r6cCs:t|}d}z|}W|r|| S|r|ww)z Determine if the lock of the given name is held or not. @type name: C{str} @param name: The filesystem path to the lock to test @rtype: C{bool} @return: True if the lock is held, False otherwise. N)r6r@rB)r7lr4rrrisLockeds   rH)rFrr rrtwisted.python.runtimerr r isWindowsr r r r5rr;rwin32apir ImportErrorrropenr$r6rH__all__rrrrs6      f