+
     HiV  c                   s    R t ^ RIt^ RIt^ RIt^ RIt]P                  ^ ,          ^8  t]'       d   ]t	Rt
Rt ! R R]4      t]P                  3R ltR tR
R ltRR	 ltR# )zEGeneric wrapper for read-eval-print-loops, a.k.a. interactive shells
Nz[PEXPECT_PROMPT>z[PEXPECT_PROMPT+c                   sN   a  ] tR t^t o Rt]]R3R ltR tRR lt	RR lt
RtV tR# )	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.
Nc                s   \        V\        4      '       d#   \        P                  ! VR RRR/R7      V n        MWn        V P                  P
                  '       d6   V P                  P                  R 4       V P                  P                  4        Vf   W n        M'V P                  VVP                  WE4      4       W@n        WPn        V P                  4        Ve   V P                  V4       R# R# )Futf-8ZNO_COLORZ1)echoencodingZenvN)Z
isinstance
basestringpexpectspawnchildr   ZsetechoZ
waitnoechoprompt
set_promptformatcontinuation_prompt_expect_promptrun_command)selfZcmd_or_spawnorig_promptprompt_changeZ
new_promptr   extra_init_cmds   &&&&&&&5/usr/lib/python3.14/site-packages/pexpect/replwrap.py__init__ZREPLWrapper.__init__!   s     lJ// |%'XbdgWhiDJ%J::??? JJu%JJ!!# %KOOK%,,ZMO$K#6 %^, &    c                sr    V P                   P                  V4       V P                   P                  V4       R # )N)r   Zexpectsendline)r   r   r      &&&r   r	   ZREPLWrapper.set_prompt<   s&    

+&

M*r   c                sh    V P                   P                  V P                  V P                  .WR 7      # ))timeoutasync_)r   Zexpect_exactr   r   )r   r   r   r   r   r   ZREPLWrapper._expect_prompt@   s4    zz&&T5M5M'N/6 ' G 	Gr   c                s   VP                  4       pVP                  R4      '       d   VP                  R4       V'       g   \        R4      hV'       d   ^RIHp V! WV4      # . pV P                  P                  V^ ,          4       VR,           FU  pV P                  VR7       VP                  V P                  P                  4       V P                  P                  V4       KW  	  V P                  VR7      ^8X  dN   V P                  P                  \        P                  4       V P                  ^R7       \        RV,           4      hRP                  W`P                  P                  .,           4      # )a  Send 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.
Z
Z zNo command was given)repl_run_command_async:i   NN)r   z2Continuation prompt found - input was incomplete:
)Z
splitlinesZendswithZappendZ
ValueErrorZ_asyncr   r   r   r   ZbeforeZkillsignalZSIGINTjoin)r   commandr   r   Zcmdlinesr   ZresZlines   &&&&    r   r   ZREPLWrapper.run_commandD   s)     %%'D!!OOB3446)$'BB

HQK(RLLD0JJtzz(()JJ% ! w/14JJOOFMM**R&' ( (xxzz001122r   )r   r   r   )iF)Z__name__Z
__module__Z__qualname__Z__firstlineno____doc__PEXPECT_PROMPTPEXPECT_CONTINUATION_PROMPTr   r	   r   r   Z__static_attributes__Z__classdictcell__)Z__classdict__s   @r   r    r       s/       +%@ $-6+G)3 )3r   r    c                s    \        V RR4      # )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   s   &r   pythonr    o   s    w)TUUr   c                 s   \         P                  ! WR RR7      p\        R,          V,           \        R,          ,           p\        R,          V,           \        R,          ,           pRP	                  WE4      p\        VRVRR7      # )	Fr   )r   r   :N   N:r!   NNz%PS1='{0}' PS2='{1}' PROMPT_COMMAND=''z\$zexport PAGER=cat)r   )r   r   r   r   r
   r    )r   argsnon_printable_insertr   Zps1Zps2r   s   &&&    r   _repl_shr$   s   sr    MM'egFE 
3
3nR6H
HC
%b
),@
@C^_aCb
bC<CCCMMufm&8: :r   c                s    \         P                  P                  \         P                  P                  \        4      R4      p\        V RV.RR7      # )z<Start a bash shell and return a :class:`REPLWrapper` object.z	bashrc.shz--rcfilez\[\]r#   )osZpathr   ZdirnameZ__file__r$   )r   Zbashrcs   & r   bashr'      s7    WW\\"''//(3[AFGj&1QQr   c                s0    \        V \        V4      RR7      # )z;Start a zsh shell and return a :class:`REPLWrapper` object.z%(!..)r%   )r$   Zlist)r   r"   s   &&r   zshr(      s    GT$ZhGGr   )r'   )r(   )z--no-rcsz-Vz+Z)r   Zos.pathr&   r   Zsysr   Zversion_infoZPY3Zstrr   r   r   Zobjectr    Z
executabler    r$   r'   r(   ) r   r   <module>r)      sm      
 
aJ$1 \3& \3| >> V:R
Hr   