404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.147.74.100: ~ $
3


.�]!�@s�dZddlZddlZddlZddlZddlZddlZddlZyddlm	Z	m
Z
Wn$ek
rtddl	m	Z	m
Z
YnXddlm
Z
mZddlmZddlmZGdd	�d	e
�ZdS)
zJProvides an interface like pexpect.spawn interface using subprocess.Popen
�N)�Queue�Empty�)�	SpawnBase�PY3)�EOF)�string_typescs�eZdZerdjd�ZndZd�fdd�	Zd	Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dd�Zdd�Zdd�Z�ZS)�
PopenSpawn�
�ascii���N�strictc
s�tt|�j||||||	d�tdtjtjtj||d�}
tjdkrjtj	�}|j
tjO_
||
d<tj|
d<t
|t�r�tjdkr�tj|tjdkd�}tj|f|
�|_|jj|_d	|_|j�|_t�|_tj|jd
�|_|jjd�|jj �dS)N)�timeout�maxread�searchwindowsize�logfile�encoding�codec_errorsr)�bufsize�stdin�stderr�stdout�cwd�env�win32�startupinfoZ
creationflags�posix)rF)�targetT)!�superr	�__init__�dict�
subprocess�PIPEZSTDOUT�sys�platformZSTARTUPINFOZdwFlagsZSTARTF_USESHOWWINDOWZCREATE_NEW_PROCESS_GROUP�
isinstancer�shlex�split�os�name�Popen�proc�pid�closedZstring_type�_bufr�_read_queue�	threadingZThread�_read_incomingZ_read_threadZ	setDaemon�start)�self�cmdrrrrrrrr�kwargsr)�	__class__��!/usr/lib/python3.6/popen_spawn.pyr s*





zPopenSpawn.__init__Fc
Cs�|j}|jr8|r*||d�|_|d|�Sd|_td��|dkrH|j}n|dkrTd}tj�}xntj�||kr�|r�t|�|kr�y|jj�}Wnt	k
r�PYq^X|dkr�d|_P||j
j|dd�7}q^W|d|�||d�}|_|j|d�|S)	NTzEnd Of File (EOF).rg��.AF)�final�read���)
r/�_read_reached_eofZflag_eofrr�time�lenr0Z
get_nowaitrZ_decoder�decode�_log)r4�sizer�bufZt0Zincoming�rr8r8r9�read_nonblocking:s0"zPopenSpawn.read_nonblockingcCsz|jjj�}xhd}ytj|d�}Wn.tk
rP}z|j|d�WYdd}~XnX|sf|jjd�dS|jj|�qWdS)z6Run in a thread to move output from a pipe to a queue.�ir;N)	r,r�filenor)r;�OSErrorrAr0Zput)r4rGrC�er8r8r9r2]szPopenSpawn._read_incomingcCs|j|�dS)zHThis is similar to send() except that there is no return value.
        N)�send)r4�sr8r8r9�writenszPopenSpawn.writecCsx|D]}|j|�qWdS)z�This 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.
        N)rJ)r4ZsequencerKr8r8r9�
writelinesss
zPopenSpawn.writelinescCsR|j|�}|j|d�|jj|dd�}tr8|jjj|�S|jjj|�t|�SdS)zbSend data to the subprocess' stdin.
        
        Returns the number of bytes written.
        rJF)r:N)	Z_coerce_send_stringrAZ_encoder�encoderr,rrLr?)r4rK�br8r8r9rJ}s
zPopenSpawn.send�cCs|j|�}||j|j�S)z�Wraps send(), sending string ``s`` to child process, with os.linesep
        automatically appended. Returns number of bytes written. )rJ�linesep)r4rK�nr8r8r9�sendline�s
zPopenSpawn.sendlinecCs8|jj�}|dkr ||_d|_nd|_||_d|_|S)zSWait for the subprocess to finish.
        
        Returns the exit code.
        rNT)r,�waitZ
exitstatusZsignalstatusZ
terminated)r4Zstatusr8r8r9rT�s
zPopenSpawn.waitcCsTtjdkr@|tjtjgkr"tj}n|tjtjgkr:tj}ntj}tj	|j
j|�dS)z�Sends a Unix signal to the subprocess.
        
        Use constants from the :mod:`signal` module to specify which signal.
        rN)r$r%�signal�SIGINTZCTRL_C_EVENTZSIGBREAKZCTRL_BREAK_EVENT�SIGTERMr)�killr,r-)r4Zsigr8r8r9rX�s
zPopenSpawn.killcCs|jjj�dS)z+Closes the stdin pipe from the writing end.N)r,r�close)r4r8r8r9�sendeof�szPopenSpawn.sendeof)rr
NNNNNr)rP)�__name__�
__module__�__qualname__rrNZcrlfr r=rEr2rLrMrJrSrTrXrZ�
__classcell__r8r8)r7r9r	s #

r	)�__doc__r)r1r"r$r>rUr'Zqueuerr�ImportErrorZ	spawnbaserr�
exceptionsrZutilsrr	r8r8r8r9�<module>s

Filemanager

Name Type Size Permission Actions
ANSI.cpython-36.opt-1.pyc File 10.01 KB 0644
ANSI.cpython-36.pyc File 10.01 KB 0644
FSM.cpython-36.opt-1.pyc File 12.37 KB 0644
FSM.cpython-36.pyc File 12.37 KB 0644
__init__.cpython-36.opt-1.pyc File 3.84 KB 0644
__init__.cpython-36.pyc File 3.84 KB 0644
_async.cpython-36.opt-1.pyc File 2.62 KB 0644
_async.cpython-36.pyc File 2.62 KB 0644
exceptions.cpython-36.opt-1.pyc File 1.77 KB 0644
exceptions.cpython-36.pyc File 1.77 KB 0644
expect.cpython-36.opt-1.pyc File 7.73 KB 0644
expect.cpython-36.pyc File 7.73 KB 0644
fdpexpect.cpython-36.opt-1.pyc File 5.52 KB 0644
fdpexpect.cpython-36.pyc File 5.52 KB 0644
popen_spawn.cpython-36.opt-1.pyc File 4.91 KB 0644
popen_spawn.cpython-36.pyc File 4.91 KB 0644
pty_spawn.cpython-36.opt-1.pyc File 30.33 KB 0644
pty_spawn.cpython-36.pyc File 30.46 KB 0644
pxssh.cpython-36.opt-1.pyc File 13.12 KB 0644
pxssh.cpython-36.pyc File 13.12 KB 0644
replwrap.cpython-36.opt-1.pyc File 4.06 KB 0644
replwrap.cpython-36.pyc File 4.06 KB 0644
run.cpython-36.opt-1.pyc File 5.61 KB 0644
run.cpython-36.pyc File 5.61 KB 0644
screen.cpython-36.opt-1.pyc File 14.29 KB 0644
screen.cpython-36.pyc File 14.29 KB 0644
spawnbase.cpython-36.opt-1.pyc File 16.75 KB 0644
spawnbase.cpython-36.pyc File 16.75 KB 0644
utils.cpython-36.opt-1.pyc File 2.89 KB 0644
utils.cpython-36.pyc File 2.89 KB 0644