관리-도구
편집 파일: serializer.cpython-37.opt-1.pyc
B b�`E � @ sF d dgZ ddlmZ ddlT ddlT G dd� de�ZG dd � d �ZdS )� Serializer�SerializerError� )� YAMLError)�*c @ s e Zd ZdS )r N)�__name__� __module__�__qualname__� r r �B/opt/alt/python37/lib64/python3.7/site-packages/yaml/serializer.pyr s c @ sJ e Zd ZdZddd�Zdd� Zdd� Zd d � Zdd� Zd d� Z dd� Z dS )r zid%03dNc C s: || _ || _|| _|| _|| _i | _i | _d| _d | _d S )N� ) �use_encoding�use_explicit_start�use_explicit_end�use_version�use_tags�serialized_nodes�anchors�last_anchor_id�closed)�self�encodingZexplicit_startZexplicit_end�version�tagsr r r �__init__ s zSerializer.__init__c C s@ | j d kr$| �t| jd�� d| _ n| j r4td��ntd��d S )N)r Fzserializer is closedzserializer is already opened)r �emitZStreamStartEventr r )r r r r �open s zSerializer.openc C s0 | j d krtd��n| j s,| �t� � d| _ d S )Nzserializer is not openedT)r r r ZStreamEndEvent)r r r r �close$ s zSerializer.closec C s| | j d krtd��n| j r"td��| �t| j| j| jd�� | �|� | �|d d � | �t | j d�� i | _i | _d| _ d S )Nzserializer is not openedzserializer is closed)�explicitr r )r r )r r r ZDocumentStartEventr r r �anchor_node�serialize_nodeZDocumentEndEventr r r r )r �noder r r � serialize. s zSerializer.serializec C s� || j kr*| j | d kr�| �|�| j |<