• File: replwrap.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/lib/python2.7/site-packages/pexpect/replwrap.pyc
  • Date Modified: 11/22/2021 6:00 PM
  • File size: 5.21 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

ڛac@sdZddlZddlZddlZddlZejddkZerXeZ	ndZ
dZdefdYZ
d	d
ZddZdS(
sEGeneric wrapper for read-eval-print-loops, a.k.a. interactive shells
iNiiu[PEXPECT_PROMPT>u[PEXPECT_PROMPT+tREPLWrappercBsGeZdZeeddZdZdedZ	dedZ
RS(sWrapper 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.
    cCst|tr0tj|dtdd|_n	||_|jjre|jjt|jjn|dkr}||_
n%|j||j||||_
||_
|j|dk	r|j|ndS(Ntechotencodingsutf-8(t
isinstancet
basestringtpexpecttspawntFalsetchildRtsetechot
waitnoechotNonetpromptt
set_prompttformattcontinuation_promptt_expect_prompttrun_command(tselftcmd_or_spawntorig_promptt
prompt_changet
new_promptRtextra_init_cmd((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyt__init__!s!				
cCs$|jj||jj|dS(N(Rtexpecttsendline(RRR((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyR
<sicCs(|jj|j|jgd|d|S(Nttimeouttasync_(Rtexpect_exactRR(RRR((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyR@scCs0|j}|jdr+|jdn|s@tdn|rfddlm}||||Sg}|jj|dxE|dD]9}|jd||j|jj	|jj|qW|jd|dkr|jj
tj|jddtd|nd	j
||jj	gS(
s0Send 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.
        :param bool async_: On Python 3.4, or Python 3.3 with asyncio
          installed, passing ``async_=True`` will make this return an
          :mod:`asyncio` Future, which you can yield from to get the same
          result that this method would normally give directly.
        s
tsNo command was giveni(trepl_run_command_asynciRs2Continuation prompt found - input was incomplete:
u(t
splitlinestendswithtappendt
ValueErrort_asyncRRRRtbeforetkilltsignaltSIGINTtjoin(RtcommandRRtcmdlinesRtrestline((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyRDs(
N(t__name__t
__module__t__doc__tPEXPECT_PROMPTtPEXPECT_CONTINUATION_PROMPTRRR
RRR(((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyRs	tpythoncCst|ddS(s>Start a Python shell and return a :class:`REPLWrapper` object.u>>> u(import sys; sys.ps1={0!r}; sys.ps2={1!r}(R(R*((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyR3ostbashcCstjjtjjtd}tj|d|gdtdd}td dtd}t	d dt	d}dj
||}t|d	|d
dS(s<Start a bash shell and return a :class:`REPLWrapper` object.s	bashrc.shs--rcfileRRsutf-8iu\[\]u%PS1='{0}' PS2='{1}' PROMPT_COMMAND=''u\$Rsexport PAGER=cat(tostpathR)tdirnamet__file__RRRR1R2RR(R*tbashrcRtps1tps2R((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyR4ss!	(R0tos.pathR5R'tsysRtversion_infotPY3tstrRR1R2tobjectRR3R4(((s3/tmp/pip-install-ztITAX/pexpect/pexpect/replwrap.pyt<module>s	^