Ë
    ojë  ã                   ó   —  G d „ d«      Z y)c                   ó@   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZeZd„ Z	d
d„Z
d	„ Zy)ÚMonkeyPatcherzn
    Cover up attributes with new objects. Neat for monkey-patching things for
    unit-testing purposes.
    c                 óL   — g | _         g | _        |D ]  } | j                  |Ž  Œ y ©N)Ú_patchesToApplyÚ
_originalsÚaddPatch)ÚselfÚpatchesÚpatchs      ú7/usr/lib/python3/dist-packages/twisted/python/monkey.pyÚ__init__zMonkeyPatcher.__init__   s0   € à!ˆÔð ˆŒØò 	"ˆEØˆD�M‰M˜5Ò!ñ	"ó    c                 ó@   — | j                   j                  |||f«       y)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Úvalues       r   r   zMonkeyPatcher.addPatch   s   € ð 	×Ñ×#Ñ# S¨$°Ð$6Õ7r   c                 óD   — | j                   D ]  \  }}}||f||fk(  sŒ y y)zc
        Has the C{name} attribute of C{obj} already been patched by this
        patcher?
        TF)r   )r	   r   r   ÚoÚnÚvs         r   Ú_alreadyPatchedzMonkeyPatcher._alreadyPatched   s5   € ð
 —‘ò 	‰GˆAˆq�!Ø�1ˆv˜#˜t˜Ó$Ùð	ð r   c           	      ó¼   — | j                   D ]M  \  }}}| j                  ||«      s(| j                  j                  ||t	        ||«      f«       t        |||«       ŒO y)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   s       r   r   zMonkeyPatcher.patch)   s\   € ð
 !%× 4Ñ 4ò 	&ÑˆC��uØ×'Ñ'¨¨TÔ2Ø—‘×&Ñ&¨¨T´7¸3ÀÓ3EÐ'FÔGÜ�C˜˜uÕ%ñ	&r   c                 óŽ   — | j                   r9| j                   j                  «       \  }}}t        |||«       | j                   rŒ8yy)zE
        Restore all original values to any patched objects.
        N)r   Úpopr   r   s       r   ÚrestorezMonkeyPatcher.restore5   s9   € ð �oŠoØ#Ÿ™×2Ñ2Ó4ÑˆC��uÜ�C˜˜uÔ%ð �o�or   Nc                 ó$   — | j                  «        y r   )r   )r	   ÚexcTypeÚexcValueÚexcTracebacks       r   Ú__exit__zMonkeyPatcher.__exit__=   s   € Ø�‰�r   c                 ó~   — | j                  «        	  ||i |¤Ž| j                  «        S # | j                  «        w xY w)z“
        Apply each patch already specified. Then run the function f with the
        given args and kwargs. Restore everything when done.
        )r   r   )r	   ÚfÚargsÚkws       r   ÚrunWithPatcheszMonkeyPatcher.runWithPatches@   s0   € ð
 	�
‰
Œð	Ù�d�>˜b‘>à�L‰L�NøˆD�L‰L�Nús   ’* ª<)NNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   Ú	__enter__r   r$   r)   © r   r   r   r      s1   „ ñò
"ò8òò&ð €Iò&óó	r   r   N)r   r/   r   r   ú<module>r0      s   ð÷Bò Br   