Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/pexpect/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/pexpect/__pycache__/fdpexpect.cpython-310.pyc
o

��!^��@sRdZddlmZddlmZmZddlmZmZddl	Z	dgZ
Gdd�de�ZdS)	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�poll_ignore_interrupts�N�fdspawncsjeZdZdZ		ddd�Zd	d
�Zdd�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����strictFc

	Cs�t|�td�krt|d�r|��}t|�td�krtd��zt�|�Wnty/td��wd|_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�hasattrrr�os�fstat�OSError�args�commandr�__init__�child_fd�own_fd�closed�name�use_poll)
�self�fdr�timeout�maxread�searchwindowsize�logfiler
rr�r"�3/usr/lib/python3/dist-packages/pexpect/fdpexpect.pyr$s&��

zfdspawn.__init__cCs2|jdkrdS|��t�|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.
        ���NT)r�flushr�closer�rr"r"r#r&?s

z
fdspawn.closecCs.|jdkrdSz	t�|j�WdSYdS)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. r$FT)rrrr'r"r"r#�isaliveMs
zfdspawn.isalivecCstd��)z1Deprecated and invalid. Just raises an exception.z.This method is not valid for file descriptors.)r)r�forcer"r"r#�	terminateYszfdspawn.terminatecCs4|�|�}|�|d�|jj|dd�}t�|j|�S)z+Write to fd, return number of bytes written�sendF)�final)�_coerce_send_string�_log�_encoder�encoder�writer)r�s�br"r"r#r+`s
zfdspawn.sendcCs|�|�}|�||j�S)zAWrite to fd with trailing newline, return number of bytes written)r-r+�linesep�rr2r"r"r#�sendlinehs
zfdspawn.sendlinecCs|�|�dS)zWrite to fd, return NoneN)r+r5r"r"r#r1msz
fdspawn.writecCs|D]}|�|�qdS)z+Call self.write() for each item in sequenceN)r1)r�sequencer2r"r"r#�
writelinesqs�zfdspawn.writelinesrr$csptjdkr0|dkr|j}|jg}g}g}|jrt||�}n
t||||�\}}}|j|vr0td��tt	|��
|�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
        �posixr$zTimeout exceeded.)rrrrrrrr�superr�read_nonblocking)r�sizer�rlist�wlist�xlist��	__class__r"r#r;vs

�
zfdspawn.read_nonblocking)Nr	r
NNNrF)F)rr$)�__name__�
__module__�__qualname__�__doc__rr&r(r*r+r6r1r8r;�
__classcell__r"r"r@r#rs
�
)rE�	spawnbaser�
exceptionsrr�utilsrrr�__all__rr"r"r"r#�<module>s

Spamworldpro Mini