관리-도구
편집 파일: generator.cpython-36.opt-2.pyc
3 ��2aN � @ s� d ddgZ ddlZddlZddlZddlZddlmZ ddlmZm Z ddl mZ dZd Z ejd �Zejdej�ZG dd � d �ZG d d� de�ZdZG dd� de�Zeeejd ��Zde ZejZdS )� Generator�DecodedGenerator�BytesGenerator� N)�deepcopy)�StringIO�BytesIO)�_has_surrogates�_� z \r\n|\r|\nz^From c @ s� e Zd Zd&dd�dd�Zdd� Zd'dd �Zd d� Zdd � Zdd� Zdd� Z dd� Z dd� Zdd� Zdd� Z e Zdd� Zdd� Zdd� Zd d!� Zed(d"d#��Zed$d%� �ZdS ))r N)�policyc C s6 |d kr|d krdn|j }|| _|| _|| _|| _d S )NT)�mangle_from_�_fp� _mangle_from_�maxheaderlenr )�self�outfpr r r � r �./opt/alt/python36/lib64/python3.6/generator.py�__init__$ s zGenerator.__init__c C s | j j|� d S )N)r �write)r �sr r r r D s zGenerator.writeFc C s� | j d kr|j n| j }|d k r*|j|d�}| jd k rB|j| jd�}|j| _| j| j�| _d| _| j| j�| _| j }|j }zL|| _ ||_ |r�|j � }|s�dt jt j � � }| j|| j � | j |� W d || _ ||_ X d S )N)�linesep)�max_line_length� zFrom nobody )r �cloner r �_NL�_encode�_encoded_NLZ_EMPTY�_encoded_EMPTYZget_unixfrom�timeZctimer �_write)r �msg�unixfromr r Zold_gen_policyZold_msg_policyZufromr r r �flattenH s, zGenerator.flattenc C s | j || jd | jd�S )N)r )� __class__r r )r �fpr r r r y s zGenerator.clonec C s t � S )N)r )r r r r �_new_buffer� s zGenerator._new_bufferc C s |S )Nr )r r r r r r � s zGenerator._encodec C sX |sd S t j|�}x*|d d� D ]}| j|� | j| j� q W |d rT| j|d � d S )N� ���r( r( )�NLCRE�splitr r )r �lines�liner r r �_write_lines� s zGenerator._write_linesc C s� | j }z"d | _| j� | _ }| j|� W d || _ | j}| `X |rht|�}|jd|d � |jd|d � t|dd �}|d kr�| j|� n|| � | j j|j � � d S )Nzcontent-transfer-encodingr zcontent-typer'