o
    Õj™  ã                   @   sH   d Z 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 )	aŒ  Column of Section.

In most cases, one section per page. But in case multi-columns page, sections are used
to distinguish these different layouts.

.. note::
    Currently, support at most two columns.

::

    {
        'bbox': (x0, y0, x1, y1),
        'blocks': [{
            ... # block instances
        }, ...],
        'shapes': [{
            ... # shape instances
        }, ...]
    }
é   )Ú
Collection)ÚLayout)ÚShape)ÚLinec                   @   s2   e Zd ZdZedd„ ƒZdefdd„Zdd„ Zd	S )
ÚColumnzColumn of Section.c                 C   s   | j S )N)Zbbox)Úself© r   úW/var/www/html/Deteccion_Ine/venv/lib/python3.10/site-packages/pdf2docx/layout/Column.pyÚworking_bbox   s   zColumn.working_bboxÚelementsc                 C   s4   dd„ |D ƒ}dd„ |D ƒ}|   |¡ |  |¡ dS )z@Add candidate elements, i.e. lines or shapes, to current column.c                 S   ó   g | ]	}t |tƒr|‘qS r   )Ú
isinstancer   ©Ú.0Úer   r   r	   Ú
<listcomp>%   ó    z'Column.add_elements.<locals>.<listcomp>c                 S   r   r   )r   r   r   r   r   r	   r   &   r   N)Zassign_blocksZassign_shapes)r   r   ÚblocksZshapesr   r   r	   Úadd_elements#   s   
zColumn.add_elementsc                 C   s   | j  |¡ dS )zrCreate Section Column in docx.

        Args:
            doc (Document): ``python-docx`` document object
        N)r   Ú	make_docx)r   Údocr   r   r	   r   +   s   zColumn.make_docxN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr
   r   r   r   r   r   r   r	   r      s    
r   N)
r   Zcommon.Collectionr   Zlayout.Layoutr   Zshape.Shaper   Z	text.Liner   r   r   r   r   r	   Ú<module>   s    