HEX
Server: nginx/1.24.0
System: Linux localhost 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64
User: www (1000)
PHP: 8.3.27
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: //usr/lib/python3/dist-packages/twisted/python/__pycache__/monkey.cpython-310.pyc
o

�bt�@sGdd�d�ZdS)c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
MonkeyPatcherzn
    Cover up attributes with new objects. Neat for monkey-patching things for
    unit-testing purposes.
    cGs$g|_g|_|D]}|j|�qdS)N)�_patchesToApply�
_originals�addPatch)�self�patches�patch�r�7/usr/lib/python3/dist-packages/twisted/python/monkey.py�__init__
s
�zMonkeyPatcher.__init__cCs|j�|||f�dS)z�
        Add a patch so that the attribute C{name} on C{obj} will be assigned to
        C{value} when C{patch} is called or during C{runWithPatches}.

        You can restore the original values with a call to restore().
        N)r�append�r�obj�name�valuerrr	rszMonkeyPatcher.addPatchcCs,|jD]\}}}||f||fkrdSqdS)zc
        Has the C{name} attribute of C{obj} already been patched by this
        patcher?
        TF)r)rr
r�o�n�vrrr	�_alreadyPatcheds
�zMonkeyPatcher._alreadyPatchedcCsF|jD]\}}}|�||�s|j�||t||�f�t|||�qdS)z�
        Apply all of the patches that have been specified with L{addPatch}.
        Reverse this operation using L{restore}.
        N)rrrr�getattr�setattrrrrr	r)s
�zMonkeyPatcher.patchcCs0|jr|j��\}}}t|||�|jsdSdS)zE
        Restore all original values to any patched objects.
        N)r�poprrrrr	�restore3s�zMonkeyPatcher.restorecOs,|��z||i|��W|��S|��w)z�
        Apply each patch already specified. Then run the function f with the
        given args and kwargs. Restore everything when done.
        )rr)r�f�args�kwrrr	�runWithPatches;szMonkeyPatcher.runWithPatchesN)
�__name__�
__module__�__qualname__�__doc__r
rrrrrrrrr	rs		

rN)rrrrr	�<module>s