文件操作 - replwrap.cpython-311.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/pexpect/__pycache__/replwrap.cpython-311.pyc
编辑文件内容
� ��!^ � � � d Z ddlZddlZddlZddlZej d dk ZereZ dZ dZ G d� de� � Z dd �Zd d�ZdS )zEGeneric wrapper for read-eval-print-loops, a.k.a. interactive shells � N� z[PEXPECT_PROMPT>z[PEXPECT_PROMPT+c �6 � e Zd ZdZeedfd�Zd� Zd d�Zd 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. Nc �� � t |t � � rt j |dd�� � | _ n|| _ | j j r3| j � d� � | j � � � |�|| _ n1| � ||� ||� � � � || _ || _ | � � � |�| � |� � d S d S )NF�utf-8��echo�encoding)� isinstance� basestring�pexpect�spawn�childr �setecho� waitnoecho�prompt� set_prompt�format�continuation_prompt�_expect_prompt�run_command)�self�cmd_or_spawn�orig_prompt� prompt_change� new_promptr �extra_init_cmds �2/usr/lib/python3/dist-packages/pexpect/replwrap.py�__init__zREPLWrapper.__init__! s� � � �l�J�/�/� &� ��|�%�'�R�R�R�D�J�J�%�D�J��:�?� $� �J���u�%�%�%��J�!�!�#�#�#�� �%�D�K�K��O�O�K�%�,�,�Z�9L�M�M� O� O� O�$�D�K�#6�� ��������%����^�,�,�,�,�,� &�%� c �n � | j � |� � | j � |� � d S )N)r �expect�sendline)r r r s r r zREPLWrapper.set_prompt<