File: //usr/local/lib/python3.6/site-packages/pexpect/__pycache__/spawnbase.cpython-36.pyc
3
��Zd�R � @ s� d dl mZmZ d dlZd dlZd dlZd dlZd dlZddlm Z m
Z
mZ ddlm
Z
mZmZ ejd dkZerveneZG dd� de�ZG d d
� d
e�ZdS )� )�StringIO�BytesION� )�ExceptionPexpect�EOF�TIMEOUT)�Expecter�searcher_string�searcher_re� c @ s, e Zd ZdZeddd��Zed dd��ZdS )
�
_NullCoderzPass bytes through unchanged.Fc C s | S )N� )�b�finalr
r
�4/tmp/pip-build-hc5bmb4z/pexpect/pexpect/spawnbase.py�encode s z_NullCoder.encodec C s | S )Nr
)r r r
r
r �decode s z_NullCoder.decodeN)F)F)�__name__�
__module__�__qualname__�__doc__�staticmethodr r r
r
r
r r
s
r c @ s� e Zd ZdZdZdZdZd4dd�Zd d
� Zdd� Z d
d� Z
dd� Zdd� Ze
ee�Zd5dd�Zdd� Zdd� Zd8dd�Zd;dd�Zd>dd�ZdAd d!�ZdCd"d#�ZdEd$d%�Zd&d'� ZdGd(d)�Zd*d+� Zd,d-� Zd.d/� Zd0d1� Zd2d3� ZdS )H� SpawnBasez�A base class providing the backwards-compatible spawn API for Pexpect.
This should not be instantiated directly: use :class:`pexpect.spawn` or
:class:`pexpect.fdpexpect.fdspawn`.
NF� �� �strictc C s� t j| _t j| _t j| _d | _d| _d | _d | _d | _d | _ d| _
d | _d | _d | _
d| _|| _t| _|| _d | _d | _|| _|| _d| _d| _d| _d| _d| _dt| � d | _d| _|| _|| _ |d k�r:t!� | _"| _#t$| _%t&| _'d | _(t)�rt$t*f| _+t,j-j.d
�| _-dd� }|| _/nt0f| _+t,j-| _-t jj1| _/nbt2j3|�|�| _"t2j4|�|�| _#t5| _%t6| _'d
| _(t5f| _+t)�r�t,j-| _-nt,j-j7d
�| _-t jj1| _/d | _8| j'� | _9| j'� | _:d S )NFTr g�������?g�������?g-C��6?�<�>s
�asciic S s8 yt jjj| �S tk
r2 t jj| jdd��S X d S )Nr �replace)�sys�stdout�buffer�write�AttributeErrorr )r r
r
r �write_to_stdout^ s z+SpawnBase.__init__.<locals>.write_to_stdoutz
���);r �stdinr! �stderr�searcher�
ignorecase�before�after�matchZmatch_indexZ
terminatedZ
exitstatusZsignalstatus�status�child_fd�timeoutr � delimiter�logfile�logfile_read�logfile_send�maxread�searchwindowsizeZdelaybeforesendZdelayaftercloseZdelayafterterminateZdelayafterread� softspace�repr�name�closed�encoding�codec_errorsr �_encoder�_decoder�bytes�string_typer �buffer_type�crlf�PY3�str�allowed_string_types�os�linesepr r% �
basestringr# �codecs�getincrementalencoder�getincrementaldecoder� text_typer r Zasync_pw_transport�_bufferZ_before)�selfr0 r5 r6 r2 r; r<