ok

Mini Shell

Direktori : /usr/lib64/python3.6/site-packages/yaml/__pycache__/
Upload File :
Current File : //usr/lib64/python3.6/site-packages/yaml/__pycache__/composer.cpython-36.pyc

3

<z�W�@sFddgZddlmZddlTddlTGdd�de�ZGdd�d�ZdS)�Composer�
ComposerError�)�MarkedYAMLError)�*c@seZdZdS)rN)�__name__�
__module__�__qualname__�r	r	� /usr/lib64/python3.6/composer.pyrsc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)rcCs
i|_dS)N)�anchors)�selfr	r	r
�__init__
szComposer.__init__cCs|jt�r|j�|jt�S)N)�check_eventZStreamStartEvent�	get_event�StreamEndEvent)rr	r	r
�
check_nodes
zComposer.check_nodecCs|jt�s|j�SdS)N)rr�compose_document)rr	r	r
�get_nodes
zComposer.get_nodecCsN|j�d}|jt�s|j�}|jt�sB|j�}td|jd|j��|j�|S)Nz(expected a single document in the streamzbut found another document)rrrrr�
start_mark)rZdocument�eventr	r	r
�get_single_nodes

zComposer.get_single_nodecCs&|j�|jdd�}|j�i|_|S)N)r�compose_noder)r�noder	r	r
r2s
zComposer.compose_documentcCs�|jt�r@|j�}|j}||jkr6tddd||j��|j|S|j�}|j}|dk	r|||jkr|td||j|jd|j��|j||�|jt	�r�|j
|�}n*|jt�r�|j|�}n|jt
�r�|j|�}|j�|S)Nzfound undefined alias %rz*found duplicate anchor %r; first occurencezsecond occurence)rZ
AliasEventr�anchorrrrZ
peek_eventZdescend_resolverZScalarEvent�compose_scalar_nodeZSequenceStartEvent�compose_sequence_nodeZMappingStartEvent�compose_mapping_nodeZascend_resolver)r�parent�indexrrrr	r	r
r?s.








zComposer.compose_nodecCs`|j�}|j}|dks|dkr0|jt|j|j�}t||j|j|j|jd�}|dk	r\||j	|<|S)N�!)�style)
r�tag�resolveZ
ScalarNode�value�implicitr�end_markr r)rrrr!rr	r	r
rXs
zComposer.compose_scalar_nodecCs�|j�}|j}|dks|dkr.|jtd|j�}t|g|jd|jd�}|dk	rV||j|<d}x*|jt	�s�|j
j|j||��|d7}q\W|j�}|j
|_
|S)Nr)�
flow_style�r)rr!r"ZSequenceNoder$rr&rrZSequenceEndEventr#�appendrr%)rr�start_eventr!rr�	end_eventr	r	r
rcs 

zComposer.compose_sequence_nodecCs�|j�}|j}|dks|dkr.|jtd|j�}t|g|jd|jd�}|dk	rV||j|<x6|jt	�s�|j
|d�}|j
||�}|jj||f�qXW|j�}|j
|_
|S)Nr)r&)rr!r"ZMappingNoder$rr&rrZMappingEndEventrr#r(r%)rrr)r!rZitem_keyZ
item_valuer*r	r	r
rus 

zComposer.compose_mapping_nodeN)rrrr
rrrrrrrrr	r	r	r
rs
N)�__all__�errorrZeventsZnodesrrr	r	r	r
�<module>s


Zerion Mini Shell 1.0