+
    e                         R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt ^ RIH	t	H
t
 ^RIHtHt ^RIHt ^RIHt  ! R R]4      tR#   ] d    ^ RI	H	t	H
t
  L2i ; i)zJProvides an interface like pexpect.spawn interface using subprocess.Popen
N)QueueEmpty)	SpawnBasePY3)EOF)string_typesc                   t   a a ] tR t^t oRV 3R lltRtR tR tR tR t	R t
RR ltR	 tR
 tR tRtVtV ;t# )
PopenSpawnc           
     "  < \         \        V `  W#WEWR 7       Vf&   \        P                  P                  R4      V n        M$V P                  \        P                  4      V n        \        ^ \        P                  \        P                  \        P                  WjVR7      p\        P                  R8X  dT   \        P                  ! 4       pV;P                  \        P                   ,          un        WR&   \        P"                  VR&   \%        V\&        4      '       d?   \        P                  R8w  d*   \(        P*                  ! V\        P,                  R8H  R7      p\        P.                  ! V3/ VB V n        V P0                  P2                  V n        R	V n        V P                  4       V n        \9        4       V n        \<        P>                  ! V P@                  R
7      V n!        RV PB                  n"        V PB                  PG                  4        R# ))timeoutmaxreadsearchwindowsizelogfileencodingcodec_errorsNascii)bufsizestdinstderrstdoutcwd
preexec_fnenvwin32startupinfocreationflagsposix)r   F)targetT)$superr	   __init__oslinesepencodecrlfstring_typedict
subprocessPIPESTDOUTsysplatformSTARTUPINFOdwFlagsSTARTF_USESHOWWINDOWCREATE_NEW_PROCESS_GROUP
isinstancer   shlexsplitnamePopenprocpidclosed_bufr   _read_queue	threadingThread_read_incoming_read_threaddaemonstart)selfcmdr   r   r   r   r   r   r   r   r   kwargsr   	__class__s   &&&&&&&&&&&  5/usr/lib/python3/dist-packages/pexpect/popen_spawn.pyr   PopenSpawn.__init__   sw    	j$(!1! 	) 	> 

))73DI(("**5DIaz'..z#? <<7"$002K:#B#BB$/=!&0&I&IF?#c<((S\\W-D++cG);<C$$S3F3	99==$$&	 7%,,D4G4GH#' !    Fc                ^   V P                   pV P                  '       d)   V'       d   W1R  V n         VR V # RV n        \        R4      hVR8X  d   V P                  pMVf   Rp\
        P
                  ! 4       p\
        P
                  ! 4       V,
          V8  de   V'       d]   \        V4      V8  dM    V P                  P                  4       pVf	   RV n        M%W0P                  P                  VRR7      ,          pK  VR V W1R  uq`n         V P                  VR4       V#   \         d     K0  i ; i)NTzEnd Of File (EOF).g    .AFfinalread)r7   _read_reached_eofflag_eofr   r   timelenr8   
get_nowait_decoderdecoder   _log)r?   sizer   buft0incomingrs   &&&    rC   read_nonblockingPopenSpawn.read_nonblockingA   s   ii!!! J	5Dz! $.//b=llG_GYY[yy{R7*tC4	C++668 #-1D*}}++HE+BB5Dz3u:9		!V  s   0D D,+D,c                X   V P                   P                  P                  4       p Rp \        P                  ! VR4      pV'       g   V P                  P                  R4       R# V P                  P                  V4       K]    \
         d   pT P                  TR4        Rp?LdRp?ii ; i)z6Run in a thread to move output from a pipe to a queue.rE   i   rI   N)	r4   r   filenor    rI   OSErrorrR   r8   put)r?   r[   rT   es   &   rC   r;   PopenSpawn._read_incomingd   s    !!((*C%ggfd+   $$T*  %  %		!V$$%s   B B)B$$B)c                (    V P                  V4       R# )zHThis is similar to send() except that there is no return value.
        Nsend)r?   ss   &&rC   writePopenSpawn.writeu   s     			!rE   c                :    V F  pV P                  V4       K  	  R# )zThis calls write() for each element in the sequence.

The sequence can be any iterable object producing strings, typically a
list of strings. This does not add line separators. There is no return
value.
Nra   )r?   sequencerc   s   && rC   
writelinesPopenSpawn.writelinesz   s     AIIaL rE   c                D   V P                  V4      pV P                  VR4       V P                  P                  VRR7      p\        '       d&   V P
                  P                  P                  V4      # V P
                  P                  P                  V4       \        V4      # )zJSend data to the subprocess' stdin.

Returns the number of bytes written.
rb   FrG   )	_coerce_send_stringrR   _encoderr"   r   r4   r   rd   rN   )r?   rc   bs   && rC   rb   PopenSpawn.send   sz    
 $$Q'		!VMM  % 0399??((++ IIOO!!!$q6MrE   c                f    V P                  V4      pW P                  V P                  4      ,           # )z~Wraps send(), sending string ``s`` to child process, with os.linesep
automatically appended. Returns number of bytes written. )rb   r!   )r?   rc   ns   && rC   sendlinePopenSpawn.sendline   s'     IIaL99T\\***rE   c                    V P                   P                  4       pV^ 8  d   Wn        RV n        MRV n        V) V n        RV n        V# )z;Wait for the subprocess to finish.

Returns the exit code.
NT)r4   wait
exitstatussignalstatus
terminated)r?   statuss   & rC   rt   PopenSpawn.wait   sE    
 !Q;$O $D"DO!'DrE   c                ~   \         P                  R8X  d}   V\        P                  \        P                  39   d   \        P                  pMFV\        P
                  \        P                  39   d   \        P                  pM\        P                  p\        P                  ! V P                  P                  V4       R# )zmSends a Unix signal to the subprocess.

Use constants from the :mod:`signal` module to specify which signal.
r   N)r)   r*   signalSIGINTCTRL_C_EVENTSIGBREAKCTRL_BREAK_EVENTSIGTERMr    killr4   r5   )r?   sigs   &&rC   r   PopenSpawn.kill   ss    
 <<7"v}}f&9&9::))&*A*ABB--nn
		s#rE   c                N    V P                   P                  P                  4        R# )z+Closes the stdin pipe from the writing end.N)r4   r   close)r?   s   &rC   sendeofPopenSpawn.sendeof   s    		rE   )r7   r8   rK   r<   r6   r#   ru   rL   r5   r4   rv   rw   )	   i  NNNNNstrictN) )__name__
__module____qualname____firstlineno__r   rK   rX   r;   rd   rh   rb   rq   rt   r   r   __static_attributes____classdictcell____classcell__)rB   __classdict__s   @@rC   r	   r	      sF     ("T !F&"
"+$   rE   r	   )__doc__r    r9   r&   r)   rM   r{   r0   queuer   r   ImportError	spawnbaser   r   
exceptionsr   utilsr   r	    rE   rC   <module>r      sW    	   
   #" &  h  h   #""#s   A	 	AA