404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.15.31.50: ~ $
3


.�]2�@sjdZddlZddlZddlZddlZejddkZer:eZ	dZ
dZGdd�de�Z
dd	d�Zd
dd
�ZdS)zEGeneric wrapper for read-eval-print-loops, a.k.a. interactive shells
�N�z[PEXPECT_PROMPT>z[PEXPECT_PROMPT+c@s<eZdZdZeedfdd�Zdd�Zd
dd	�Zdd
d�Z	dS)�REPLWrappera�Wrapper for a REPL.

    :param cmd_or_spawn: This can either be an instance of :class:`pexpect.spawn`
      in which a REPL has already been started, or a str command to start a new
      REPL process.
    :param str orig_prompt: The prompt to expect at first.
    :param str prompt_change: A command to change the prompt to something more
      unique. If this is ``None``, the prompt will not be changed. This will
      be formatted with the new and continuation prompts as positional
      parameters, so you can use ``{}`` style formatting to insert them into
      the command.
    :param str new_prompt: The more unique prompt to expect after the change.
    :param str extra_init_cmd: Commands to do extra initialisation, such as
      disabling pagers.
    NcCs�t|t�rtj|ddd�|_n||_|jjrB|jjd�|jj�|dkrR||_n|j	||j
||��||_||_|j�|dk	r�|j
|�dS)NFzutf-8)�echo�encoding)�
isinstance�
basestring�pexpect�spawn�childrZsetechoZ
waitnoecho�prompt�
set_prompt�format�continuation_prompt�_expect_prompt�run_command)�selfZcmd_or_spawn�orig_prompt�
prompt_changeZ
new_promptr�extra_init_cmd�r�/usr/lib/python3.6/replwrap.py�__init__!s

zREPLWrapper.__init__cCs|jj|�|jj|�dS)N)r
�expect�sendline)rrrrrrr<szREPLWrapper.set_prompt�cCs|jj|j|jg|d�S)N)�timeout)r
Zexpect_exactrr)rrrrrr@szREPLWrapper._expect_promptcCs�|j�}|jd�r|jd�|s(td��g}|jj|d�x:|dd�D]*}|j|d�|j|jj�|jj|�qJW|j|d�dkr�|jjt	j
�|jdd�td|��dj||jjg�S)	aSend a command to the REPL, wait for and return output.

        :param str command: The command to send. Trailing newlines are not needed.
          This should be a complete block of input that will trigger execution;
          if a continuation prompt is found after sending input, :exc:`ValueError`
          will be raised.
        :param int timeout: How long to wait for the next prompt. -1 means the
          default from the :class:`pexpect.spawn` object (default 30 seconds).
          None means to wait indefinitely.
        �
�zNo command was givenrrN)rz2Continuation prompt found - input was incomplete:
)�
splitlines�endswith�append�
ValueErrorr
rrZbefore�kill�signal�SIGINT�join)r�commandrZcmdlines�res�linerrrrDs"

zREPLWrapper.run_command���)r)r))r))
�__name__�
__module__�__qualname__�__doc__�PEXPECT_PROMPT�PEXPECT_CONTINUATION_PROMPTrrrrrrrrrs
r�pythoncCst|dd�S)z>Start a Python shell and return a :class:`REPLWrapper` object.z>>> z(import sys; sys.ps1={0!r}; sys.ps2={1!r})r)r&rrrr0gs�bashcCs�tjjtjjt�d�}tj|d|gddd�}tdd�dtdd�}tdd�dtdd�}d	j	||�}t
|d
|dd�S)
z<Start a bash shell and return a :class:`REPLWrapper` object.z	bashrc.shz--rcfileFzutf-8)rrN�z\[\]z%PS1='{0}' PS2='{1}' PROMPT_COMMAND=''z\$zexport PAGER=cat)r)�os�pathr%�dirname�__file__rr	r.r/r
r)r&Zbashrcr
Zps1Zps2rrrrr1ks)r0)r1)r-Zos.pathr3r#�sysr�version_infoZPY3�strrr.r/�objectrr0r1rrrr�<module>sV


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