Your IP : 172.28.240.42


Current Path : /usr/lib/python2.7/dist-packages/twisted/python/
Upload File :
Current File : //usr/lib/python2.7/dist-packages/twisted/python/monkey.pyc

ó
[³XMc@sdefd„ƒYZdS(t
MonkeyPatchercBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(sn
    Cover up attributes with new objects. Neat for monkey-patching things for
    unit-testing purposes.
    cGs4g|_g|_x|D]}|j|ŒqWdS(N(t_patchesToApplyt
_originalstaddPatch(tselftpatchestpatch((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pyt__init__
s		
cCs|jj|||fƒdS(sæ
        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(Rtappend(Rtobjtnametvalue((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pyRscCs=x6|jD]+\}}}||f||fkr
tSq
WtS(sc
        Has the C{name} attribute of C{obj} already been patched by this
        patcher?
        (RtTruetFalse(RR	R
totntv((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pyt_alreadyPatched!scCshxa|jD]V\}}}|j||ƒsP|jj||t||ƒfƒnt|||ƒq
WdS(s†
        Apply all of the patches that have been specified with L{addPatch}.
        Reverse this operation using L{restore}.
        N(RRRRtgetattrtsetattr(RR	R
R((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pyR,s%cCs<x5|jr7|jjƒ\}}}t|||ƒqWdS(sE
        Restore all original values to any patched objects.
        N(RtpopR(RR	R
R((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pytrestore7scOs-|jƒz|||ŽSWd|jƒXdS(s“
        Apply each patch already specified. Then run the function f with the
        given args and kwargs. Restore everything when done.
        N(RR(Rtftargstkw((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pytrunWithPatches@s
(	t__name__t
__module__t__doc__RRRRRR(((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pyRs	
	
				N(tobjectR(((s9/usr/lib/python2.7/dist-packages/twisted/python/monkey.pyt<module>s