U
    .R”iy  ã                   @   s$   d Z ddlmZ G dd„ deƒZdS )zz
Utility list for top level containers that contain one type of element

Provides the necessary API to read and write XML
é    )ÚElementc                       sH   e Zd Zedd„ ƒZedd„ ƒZedd„ ƒZdd„ Z‡ fd	d
„Z	‡  Z
S )ÚElementListc                 C   s   t ‚d S ©N©ÚNotImplementedError©Úself© r	   úB/tmp/pip-unpacked-wheel-r0v169r1/openpyxl/descriptors/container.pyÚtagname   s    zElementList.tagnamec                 C   s   t ‚d S r   r   r   r	   r	   r
   Úexpected_type   s    zElementList.expected_typec                    s   ‡ fdd„|D ƒ}ˆ |ƒS )Nc                    s   g | ]}ˆ j  |¡‘qS r	   )r   Ú	from_tree)Ú.0Úel©Úclsr	   r
   Ú
<listcomp>   s     z)ElementList.from_tree.<locals>.<listcomp>r	   )r   ÚtreeÚlr	   r   r
   r      s    zElementList.from_treec                 C   s&   t | jƒ}| D ]}| | ¡ ¡ q|S r   )r   r   ÚappendÚto_tree)r   Ú	containerr   r	   r	   r
   r      s    
zElementList.to_treec                    s8   t || jƒs(td| j› dt|ƒ› d�ƒ‚tƒ  |¡ d S )NzValue must of type ú z	 provided)Ú
isinstancer   Ú	TypeErrorÚtypeÚsuperr   )r   Úvalue©Ú	__class__r	   r
   r   &   s    zElementList.append)Ú__name__Ú
__module__Ú__qualname__Úpropertyr   r   Úclassmethodr   r   r   Ú__classcell__r	   r	   r   r
   r      s   


r   N)Ú__doc__Zopenpyxl.xml.functionsr   Úlistr   r	   r	   r	   r
   Ú<module>   s   