o
    .&ßaH  ã                   @   s|   d dl Z d dlmZ G dd„ de jƒZG dd„ de jƒZdd„ Ze e j	j
je¡ d	d
„ Ze ee¡ dd„ Zddd„ZdS )é    N)ÚOrderedDictc                   @   ó   e Zd ZdZdS )ÚSafeOrderedLoaderz- Safely load a yaml file into an OrderedDict.N©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   úH/usr/lib/python3/dist-packages/awscli/customizations/eks/ordered_yaml.pyr      ó    r   c                   @   r   )ÚSafeOrderedDumperz$ Safely dump an OrderedDict as yaml.Nr   r
   r
   r
   r   r      r   r   c                 C   s   |   |¡ t|  |¡ƒS ©N)Úflatten_mappingr   Úconstruct_pairs)ÚloaderÚnoder
   r
   r   Ú_ordered_constructor   s   
r   c                 C   s   |   tjjj| ¡ ¡S r   )Úrepresent_mappingÚyamlÚresolverÚBaseResolverÚDEFAULT_MAPPING_TAGÚitems)ÚdumperÚdatar
   r
   r   Ú_ordered_representer$   s   þr   c                 C   s   t  | t¡S )z/ Load an OrderedDict object from a yaml stream.)r   Úloadr   )Ústreamr
   r
   r   Úordered_yaml_load-   s   r   c                 C   s   t j| |tdd�S )zë
    Dump an OrderedDict object to yaml.

    :param to_dump: The OrderedDict to dump
    :type to_dump: OrderedDict

    :param stream: The file to dump to
    If not given or if None, only return the value
    :type stream: file
    F)Údefault_flow_style)r   Údumpr   )Úto_dumpr   r
   r
   r   Úordered_yaml_dump2   s   ÿr#   r   )r   Úbotocore.compatr   Ú
SafeLoaderr   Ú
SafeDumperr   r   Úadd_constructorr   r   r   r   Úadd_representerr   r#   r
   r
   r
   r   Ú<module>   s   þ