+
    üÐjê!  ã                   ó@  € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
Ht RR lt ! R R]4      t ! R	 R
]	P                  4      tR/ RR^ 3R lt ! R R]	P                  4      tR/ RR3R lt ! R R]	P                  4      tR/ RRR3R ltR tR tR t. ROtR# )z
Utility methods.
N©Úwraps)ÚBytesIO)ÚdeferÚprotocol)Úfailurec                 ó    € Vf   ^ RI Hp \        P                  ! 4       pV ! V.VO5!  pVP	                  W�V3\        V4      ,           W44       V# )N)Úreactor)Útwisted.internetr	   r   ÚDeferredÚspawnProcessÚtuple)	r   Ú
executableÚargsÚenvÚpathr	   Ú	protoArgsÚdÚps	   &&&&&&&  Ú8/usr/lib/python3/dist-packages/twisted/internet/utils.pyÚ_callProtocolWithDeferredr      sI   € ð ‚Ý,ä�ŠÓ€AÙ�Ð�YÓ€AØ×Ñ˜¨¨¼¸d»Õ(CÀSÔOØ€Hó    c                   ó*   a € ] tR t^t o RtR tRtV tR# )Ú_UnexpectedErrorOutputa]  
Standard error data was received where it was not expected.  This is a
subclass of L{IOError} to preserve backward compatibility with the previous
error behavior of L{getProcessOutput}.

@ivar processEnded: A L{Deferred} which will fire when the process which
    produced the data on stderr has ended (exited and all file descriptors
    closed).
c                óF   € \         P                  V R V: 24       W n        R# )zgot stderr: N)ÚIOErrorÚ__init__ÚprocessEnded)ÚselfÚtextr   s   &&&r   r   Ú_UnexpectedErrorOutput.__init__*   s   € Ü×Ñ˜ ¨d©XÐ6Ô7Ø(Ör   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r   r   r      s   ø‡ € ñ÷)ð )r   r   c                   óF   a € ] tR t^/t o RtR	R ltR tR tR tR t	Rt
V tR# )
Ú
_BackRelaya  
Trivial protocol for communicating with a process and turning its output
into the result of a L{Deferred}.

@ivar deferred: A L{Deferred} which will be called back with all of stdout
    and, if C{errortoo} is true, all of stderr as well (mixed together in
    one string).  If C{errortoo} is false and any bytes are received over
    stderr, this will fire with an L{_UnexpectedErrorOutput} instance and
    the attribute will be set to L{None}.

@ivar onProcessEnded: If C{errortoo} is false and bytes are received over
    stderr, this attribute will refer to a L{Deferred} which will be called
    back when the process ends.  This C{Deferred} is also associated with
    the L{_UnexpectedErrorOutput} which C{deferred} fires with earlier in
    this case so that users can determine when the process has actually
    ended, in addition to knowing when bytes have been received via stderr.
c                óˆ   € Wn         \        4       V n        V'       d   V P                  V n        R # V P
                  V n        R # ©N)Údeferredr   ÚsÚerrReceivedIsGoodÚerrReceivedÚerrReceivedIsBad)r   r.   Úerrortoos   &&&r   r   Ú_BackRelay.__init__B   s/   € Ø ŒÜ“ˆŒßØ#×5Ñ5ˆDÖà#×4Ñ4ˆDÖr   c                ó$  € V P                   e‚   \        P                  ! 4       V n        \	        WP                  4      pV P                   P                  \        P                  ! V4      4       R V n         V P                  P                  4        R # R # r-   )
r.   r   r   ÚonProcessEndedr   Úerrbackr   ÚFailureÚ	transportÚloseConnection)r   r   Úerrs   && r   r2   Ú_BackRelay.errReceivedIsBadJ   sb   € Ø�=‰=Ò$Ü"'§.¢.Ó"2ˆDÔÜ(¨×/BÑ/BÓCˆCØ�M‰M×!Ñ!¤'§/¢/°#Ó"6Ô7Ø ˆDŒMØ�N‰N×)Ñ)Ö+ñ %r   c                ó<   € V P                   P                  V4       R # r-   ©r/   Úwrite©r   r   s   &&r   r0   Ú_BackRelay.errReceivedIsGoodR   ó   € Ø�‰�‰�TÖr   c                ó<   € V P                   P                  V4       R # r-   r>   r@   s   &&r   ÚoutReceivedÚ_BackRelay.outReceivedU   rB   r   c                óâ   € V P                   e6   V P                   P                  V P                  P                  4       4       R # V P                  e   V P                  P                  V4       R # R # r-   )r.   Úcallbackr/   Úgetvaluer6   r7   ©r   Úreasons   &&r   r   Ú_BackRelay.processEndedX   sN   € Ø�=‰=Ò$Ø�M‰M×"Ñ" 4§6¡6§?¡?Ó#4Ö5Ø× Ñ Ò,Ø×Ñ×'Ñ'¨Ö/ñ -r   )r.   r1   r6   r/   N)é    )r!   r"   r#   r$   r%   r   r2   r0   rD   r   r&   r'   r(   s   @r   r+   r+   /   s(   ø‡ € ñô$5ò,òò÷0ð 0r   r+   c                ó(   a€ \        V3R lWW#V4      # )a¥  
Spawn a process and return its output as a deferred returning a L{bytes}.

@param executable: The file name to run and get the output of - the
                   full path should be used.

@param args: the command line arguments to pass to the process; a
             sequence of strings. The first string should B{NOT} be the
             executable's name.

@param env: the environment variables to pass to the process; a
            dictionary of strings.

@param path: the path to run the subprocess in - defaults to the
             current directory.

@param reactor: the reactor to use - defaults to the default reactor

@param errortoo: If true, include stderr in the result.  If false, if
    stderr is received the returned L{Deferred} will errback with an
    L{IOError} instance with a C{processEnded} attribute.  The
    C{processEnded} attribute refers to a L{Deferred} which fires when the
    executed process ends.
c                 ó   <€ \        V SR 7      # ))r3   )r+   )r   r3   s   &€r   Ú<lambda>Ú"getProcessOutput.<locals>.<lambda>y   s   ø€ ”*˜Q¨Õ2r   )r   )r   r   r   r   r	   r3   s   &&&&&fr   ÚgetProcessOutputrQ   _   s   ø€ ô2 %Ü2°JÀcÐQXóð r   c                   ó,   a € ] tR t^}t o R tR tRtV tR# )Ú_ValueGetterc                ó   € Wn         R # r-   ©r.   )r   r.   s   &&r   r   Ú_ValueGetter.__init__~   s   € Ø Žr   c                ód   € V P                   P                  VP                  P                  4       R # r-   )r.   rG   ÚvalueÚexitCoderI   s   &&r   r   Ú_ValueGetter.processEnded�   s   € Ø�‰×Ñ˜vŸ|™|×4Ñ4Ö5r   rU   N)r!   r"   r#   r$   r   r   r&   r'   r(   s   @r   rS   rS   }   s   ø‡ € ò!÷6ð 6r   rS   c                ó&   € \        \        WW#V4      # )z7Spawn a process and return its exit code as a Deferred.)r   rS   )r   r   r   r   r	   s   &&&&&r   ÚgetProcessValuer\   …   s   € ä$¤\°:ÀSÐPWÓXÐXr   c                   ó6   a € ] tR t^Št o RR ltR tR tRtV tR# )Ú_EverythingGetterNc                óÆ   € Wn         \        4       V n        \        4       V n        V P                  P                  V n        V P                  P                  V n        W n        R # r-   )r.   r   ÚoutBufÚerrBufr?   rD   r1   Ú
stdinBytes)r   r.   rb   s   &&&r   r   Ú_EverythingGetter.__init__‹   sB   € Ø ŒÜ“iˆŒÜ“iˆŒØŸ;™;×,Ñ,ˆÔØŸ;™;×,Ñ,ˆÔØ$Žr   c                ó¦   € V P                   eC   V P                  P                  ^ V P                   4       V P                  P                  4        R # R # r-   )rb   r9   ÚwriteToChildÚ
closeStdin)r   s   &r   ÚconnectionMadeÚ _EverythingGetter.connectionMade“   s;   € Ø�?‰?Ò&Ø�N‰N×'Ñ'¨¨4¯?©?Ô;ð �N‰N×%Ñ%Ö'ñ	 'r   c                óN  € V P                   P                  4       pV P                  P                  4       pVP                  pVP                  pVP
                  '       d*   V P                  P                  W#VP
                  34       R # V P                  P                  W#V34       R # r-   )	r`   rH   ra   rX   rY   Úsignalr.   r7   rG   )r   rJ   Úoutr;   ÚeÚcodes   &&    r   r   Ú_EverythingGetter.processEndedš   ss   € Ø�k‰k×"Ñ"Ó$ˆØ�k‰k×"Ñ"Ó$ˆØ�L‰LˆØ�z‰zˆØ�8�8ˆ8Ø�M‰M×!Ñ! 3¨Q¯X©XÐ"6Ö7à�M‰M×"Ñ" C¨dÐ#3Ö4r   )r.   ra   r1   r`   rD   rb   r-   )	r!   r"   r#   r$   r   rg   r   r&   r'   r(   s   @r   r^   r^   Š   s   ø‡ € ô%ò(÷5ð 5r   r^   c           
     ó0   € \        \        V VVVVV3R7      # )a  Spawn a process and returns a Deferred that will be called back with
its output (from stdout and stderr) and it's exit code as (out, err, code)
If a signal is raised, the Deferred will errback with the stdout and
stderr up to that point, along with the signal, as (out, err, signalNum)
)r   )r   r^   )r   r   r   r   r	   rb   s   &&&&&&r   ÚgetProcessOutputAndValuerp   ¥   s(   € ô %ÜØØØØØØ�-ôð r   c                 ó|   € V F#  p \         P                  P                  V4       K%  	  V #   \         d     K7  i ; ir-   )ÚwarningsÚfiltersÚremoveÚ
ValueError)ÚpassthroughÚaddedFiltersÚfs   && r   Ú_resetWarningFiltersry   ¸   sA   € Ûˆð	Ü×Ñ×#Ñ# AÖ&ñ ð
 Ðøô ô 	Úð	ús   ‡,¬;º;c                ó¸  € V  F  w  rE\         P                  ! V/ VB  K  	  \         P                  R\        V 4       p V! V/ VB p\	        V\
        P                  4      '       d   VP                  \        V4       V# \        RV4       V#   \         dB    \        P                  ! 4       p\        RT4       T^,          P                  T^,          4      hi ; i)a=  
Run the function I{f}, but with some warnings suppressed.

This calls L{warnings.filterwarnings} to add warning filters before
invoking I{f}. If I{f} returns a L{Deferred} then the added filters are
removed once the deferred fires. Otherwise they are removed immediately.

Note that the list of warning filters is a process-wide resource, so
calling this function will affect all threads.

@param suppressedWarnings:
    A list of arguments to pass to L{warnings.filterwarnings}, a sequence
    of (args, kwargs) 2-tuples.

@param f: A callable, which may return a L{Deferred}.

@param a: Positional arguments passed to I{f}

@param kw: Keyword arguments passed to I{f}

@return: The result of C{f(*a, **kw)}

@seealso: L{twisted.python.util.runWithWarningsSuppressed}
    functions similarly, but doesn't handled L{Deferred}s.
N)rr   Úfilterwarningsrs   ÚlenÚ
isinstancer   r   ÚaddBothry   ÚBaseExceptionÚsysÚexc_infoÚwith_traceback)	ÚsuppressedWarningsrx   ÚaÚkwr   Úkwargsrw   Úresultr�   s	   &&*,     r   ÚrunWithWarningsSuppressedrˆ   Á   sÇ   € ó4 +‰ˆÜ×Ò Ð0¨Ô0ñ +ä×#Ñ#Ð$=¤cÐ*<Ó&=Ð>€LðÙ�A�˜‘ˆô �fœeŸn™n×-Ò-Ø�N‰NÔ/°Ô>ð ˆô !  |Ô4Øˆøô ô 6Ü—<’<“>ˆÜ˜T <Ô0Ø�q�k×(Ñ(¨°!­Ó5Ð5ð6ús   ¿B ÂACc                ó4   a a€ \        S 4      V V3R l4       pV# )zÌ
Wrap C{f} in a callable which suppresses the indicated warnings before
invoking C{f} and unsuppresses them afterwards.  If f returns a Deferred,
warnings will remain suppressed until the Deferred fires.
c                  ó$   <€ \        SS.V O5/ VB # r-   )rˆ   )r„   r…   rx   rƒ   s   *,€€r   ÚwarningSuppressingWrapperÚ3suppressWarnings.<locals>.warningSuppressingWrapperó   s   ø€ ä(Ð);¸QÐIÀÒIÀbÑIÐIr   r   )rx   rƒ   r‹   s   fj r   ÚsuppressWarningsr�   ì   s%   ù€ ô ˆ1ƒXõJó ðJð %Ð$r   © )NrŽ   )rˆ   r�   rQ   r\   rp   )r%   r€   rr   Ú	functoolsr   Úior   r
   r   r   Útwisted.pythonr   r   r   r   ÚProcessProtocolr+   rQ   rS   r\   r^   rp   ry   rˆ   r�   Ú__all__rŽ   r   r   Ú<module>r”      s³   ðñ
ó
 Û Ý Ý ç ,Ý "ô	ô)˜Wô )ô -0�×)Ñ)ô -0ð` ')¨b°tÀTÐTUô ô<6�8×+Ñ+ô 6ð &(¨R°dÀDô Yô
5˜×0Ñ0ô 5ð8 ˜R d°DÀTôò&ò(òV%ò‚r   