404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@13.59.58.185: ~ $
3


.�]��@sNdZddlmZddlmZmZddlmZddlZdgZ	Gdd�de�Z
dS)	azThis is like pexpect, but it will work with any file descriptor that you
pass it. You are responsible for opening and close the file descriptor.
This allows you to use Pexpect with sockets and named pipes (FIFOs).

PEXPECT LICENSE

    This license is approved by the OSI and FSF as GPL-compatible.
        http://opensource.org/licenses/isc-license.txt

    Copyright (c) 2012, Noah Spurrier <noah@noah.org>
    PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
    PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE
    COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES.
    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

�)�	SpawnBase)�ExceptionPexpect�TIMEOUT)�select_ignore_interrupts�N�fdspawncsfeZdZdZddd�Zdd	�Zd
d�Zdd
d�Zdd�Zdd�Z	dd�Z
dd�Zd�fdd�	Z�Z
S)rz�This is like pexpect.spawn but allows you to supply your own open file
    descriptor. For example, you could use it to read through a file looking
    for patterns, or to control a modem or serial device. N����strictc		Cs�t|�td�kr"t|d�r"|j�}t|�td�kr:td��ytj|�Wntk
rdtd��YnXd|_d|_t	j
|||||||d�||_d|_d|_
d||_dS)	z�This takes a file descriptor (an int) or an object that support the
        fileno() method (returning an int). All Python file-like objects
        support fileno(). r�filenozdThe fd argument is not an int. If this is a command string then maybe you want to use pexpect.spawn.z/The fd argument is not a valid file descriptor.N)�encoding�codec_errorsFz<file descriptor %d>)�type�hasattrrr�os�fstat�OSError�argsZcommandr�__init__�child_fdZown_fd�closed�name)	�self�fdr�timeoutZmaxreadZsearchwindowsizeZlogfilerr
�r�/usr/lib/python3.6/fdpexpect.pyr$s 
zfdspawn.__init__cCs2|jdkrdS|j�tj|j�d|_d|_dS)z�Close the file descriptor.

        Calling this method a second time does nothing, but if the file
        descriptor was closed elsewhere, :class:`OSError` will be raised.
        rNT���r)r�flushr�closer)rrrrr>s
z
fdspawn.closec	Cs.|jdkrdSytj|j�dSdSdS)z�This checks if the file descriptor is still valid. If :func:`os.fstat`
        does not raise an exception then we assume it is alive. rFTNr)rrr)rrrr�isaliveLs
zfdspawn.isaliveFcCstd��dS)z1Deprecated and invalid. Just raises an exception.z.This method is not valid for file descriptors.N)r)r�forcerrr�	terminateXszfdspawn.terminatecCs4|j|�}|j|d�|jj|dd�}tj|j|�S)z+Write to fd, return number of bytes written�sendF)�final)�_coerce_send_stringZ_logZ_encoder�encoder�writer)r�s�brrrr#_s
zfdspawn.sendcCs|j|�}|j||j�S)zAWrite to fd with trailing newline, return number of bytes written)r%r#�linesep)rr(rrr�sendlinegs
zfdspawn.sendlinecCs|j|�dS)zWrite to fd, return NoneN)r#)rr(rrrr'lsz
fdspawn.writecCsx|D]}|j|�qWdS)z+Call self.write() for each item in sequenceN)r')rZsequencer(rrr�
writelinesps
zfdspawn.writelinesrcs^tjdkrN|dkr|j}|jg}g}g}t||||�\}}}|j|krNtd��tt|�j|�S)a�
        Read from the file descriptor and return the result as a string.

        The read_nonblocking method of :class:`SpawnBase` assumes that a call
        to os.read will not block (timeout parameter is ignored). This is not
        the case for POSIX file-like objects such as sockets and serial ports.

        Use :func:`select.select`, timeout is implemented conditionally for
        POSIX systems.

        :param int size: Read at most *size* bytes.
        :param int timeout: Wait timeout seconds for file descriptor to be
            ready to read. When -1 (default), use self.timeout. When 0, poll.
        :return: String containing the bytes read
        �posixrzTimeout exceeded.r)	rrrrrr�superr�read_nonblocking)r�sizerZrlistZwlistZxlist)�	__class__rrr/us

zfdspawn.read_nonblocking)Nrr	NNNr
)Fr)rr)�__name__�
__module__�__qualname__�__doc__rrr r"r#r+r'r,r/�
__classcell__rr)r1rrs

)r5Z	spawnbaser�
exceptionsrrZutilsrr�__all__rrrrr�<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