관리-도구
편집 파일: serializer.cpython-38.pyc
U .?�fE � @ 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 �?/opt/hc_python/lib64/python3.8/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 F�serializer 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 )N�serializer is not openedT)r r r ZStreamEndEventr 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 )Nr r )�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 |<