HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/docx/__pycache__/shape.cpython-310.pyc
o

$web
�@sJdZddlmZddlmZddlmZGdd�de�ZGdd�d�Zd	S)
zhObjects related to shapes.

A shape is a visual object that appears on the drawing layer of a document.
�)�WD_INLINE_SHAPE)�nsmap)�ParentedcsDeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zed
d��Z	�Z
S)�InlineShapeszYSequence of |InlineShape| instances, supporting len(), iteration, and indexed
    access.cstt|��|�||_dS�N)�superr�__init__�_body)�self�body_elm�parent��	__class__��C/home/arjun/projects/env/lib/python3.10/site-packages/docx/shape.pyrs
zInlineShapes.__init__cCs4z
|j|}Wt|�Styd|}t|��w)z2Provide indexed access, e.g. 'inline_shapes[idx]'.z$inline shape index [%d] out of range)�_inline_lst�
IndexError�InlineShape)r
�idx�inline�msgrrr�__getitem__s��zInlineShapes.__getitem__cCsdd�|jD�S)Ncss�|]}t|�VqdSr)r)�.0rrrr�	<genexpr>s�z(InlineShapes.__iter__.<locals>.<genexpr>)r�r
rrr�__iter__szInlineShapes.__iter__cCs
t|j�Sr)�lenrrrrr�__len__s
zInlineShapes.__len__cCs|j}d}|�|�S)Nz//w:p/w:r/w:drawing/wp:inline)r	�xpath)r
�bodyrrrrr"s
zInlineShapes._inline_lst)�__name__�
__module__�__qualname__�__doc__rrrr�propertyr�
__classcell__rrr
rrs	rcs`eZdZdZ�fdd�Zedd��Zejdd��Zedd��Zed	d
��Z	e	jdd
��Z	�Z
S)rzdProxy for an ``<wp:inline>`` element, representing the container for an inline
    graphical object.cstt|���||_dSr)rrr�_inline)r
rr
rrr-s
zInlineShape.__init__cC�
|jjjS)z[Read/write.

        The display height of this inline shape as an |Emu| instance.
        )r&�extent�cyrrrr�height1�
zInlineShape.heightcC�||jj_||jjjjj_dSr)r&r(r)�graphic�graphicData�pic�spPr)r
r)rrrr*9�
cCsf|jjj}|j}|tdkr|jjj}|jdurt	j
St	jS|tdkr't	jS|tdkr0t	j
St	jS)z�The type of this inline shape as a member of
        ``docx.enum.shape.WD_INLINE_SHAPE``, e.g. ``LINKED_PICTURE``.

        Read-only.
        r/N�c�dgm)r&r-r.�urirr/�blipFill�blip�linkr�LINKED_PICTURE�PICTURE�CHART�	SMART_ART�NOT_IMPLEMENTED)r
r.r4r6rrr�type>s


zInlineShape.typecCr')zZRead/write.

        The display width of this inline shape as an |Emu| instance.
        )r&r(�cxrrrr�widthRr+zInlineShape.widthcCr,r)r&r(r>r-r.r/r0)r
r>rrrr?Zr1)r r!r"r#rr$r*�setterr=r?r%rrr
rr)s



rN)	r#�docx.enum.shaper�docx.oxml.nsr�docx.sharedrrrrrrr�<module>s