Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/python/__pycache__/monkey.cpython-39.pyc
Ðазад
a k�ht � @ s G d d� d�Z dS )c @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dS )� MonkeyPatcherzn Cover up attributes with new objects. Neat for monkey-patching things for unit-testing purposes. c G s$ g | _ g | _|D ]}| j|� qd S )N)�_patchesToApply� _originals�addPatch)�selfZpatches�patch� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/python/monkey.py�__init__ s zMonkeyPatcher.__init__c C s | 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�valuer r r r s zMonkeyPatcher.addPatchc C s, | j D ] \}}}||f||fkr dS qdS )zc Has the C{name} attribute of C{obj} already been patched by this patcher? TF)r )r r r �o�n�vr r r �_alreadyPatched s zMonkeyPatcher._alreadyPatchedc C sF | j D ]:\}}}| �||�s4| 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)r r r r �getattr�setattrr r r r r ) s zMonkeyPatcher.patchc C s( | j r$| j �� \}}}t|||� q dS )zE Restore all original values to any patched objects. N)r �popr r r r r �restore3 s zMonkeyPatcher.restorec O s0 | � � z||i |��W | �� S | �� 0 dS )z� Apply each patch already specified. Then run the function f with the given args and kwargs. Restore everything when done. N)r r )r �f�args�kwr r r �runWithPatches; s �zMonkeyPatcher.runWithPatchesN) �__name__� __module__�__qualname__�__doc__r r r r r r r r r r r s r N)r r r r r �<module> �
| ver. 1.1 | |
.
| PHP 8.3.30 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка