U
    {®Þhþ  ã                   @   sD   d dl mZ d dlmZ d dlmZ d dlmZ G dd„ deƒZdS )é    )ÚList©Úget_image_model)Úget_image_format)ÚEmbedHandlerc                   @   sX   e Zd ZdZedd„ ƒZeeedœdd„ƒZ	ee
e e
e dœdd	„ƒZed
d„ ƒZdS )ÚImageEmbedHandlerÚimagec                   C   s   t ƒ S )Nr   © r	   r	   úi/var/www/dating/data/www/fatepal.com/env/lib/python3.8/site-packages/wagtail/images/rich_text/__init__.pyÚ	get_model   s    zImageEmbedHandler.get_model)ÚattrsÚreturnc                 C   s   |   |g¡d S )Nr   )Úexpand_db_attributes_many©Úclsr   r	   r	   r
   Úexpand_db_attributes   s    z&ImageEmbedHandler.expand_db_attributes)Ú
attrs_listr   c                 C   sZ   |   |¡}g }t||ƒD ]<\}}|rFt|d ƒ}| || dd¡¡}nd}| |¡ q|S )zˆ
        Given a dict of attributes from the <embed> tag, return the real HTML
        representation for use on the front-end.
        ÚformatZaltÚ z<img alt="">)Zget_manyÚzipr   Zimage_to_htmlÚgetÚappend)r   r   ZimagesÚtagsr   r   Zimage_formatÚtagr	   r	   r
   r      s    
z+ImageEmbedHandler.expand_db_attributes_manyc                 c   s   |   ¡ |d ddfV  d S )NÚidr   )r   r   r	   r	   r
   Úextract_references)   s    z$ImageEmbedHandler.extract_referencesN)Ú__name__Ú
__module__Ú__qualname__Ú
identifierÚstaticmethodr   ÚclassmethodÚdictÚstrr   r   r   r   r	   r	   r	   r
   r   
   s   
r   N)	Útypingr   Zwagtail.imagesr   Zwagtail.images.formatsr   Zwagtail.rich_textr   r   r	   r	   r	   r
   Ú<module>   s   