File: //home/arjun/projects/env/lib64/python3.10/site-packages/docx/__pycache__/shape.cpython-310.pyc
o
$web
� @ sJ d Z ddlmZ ddlmZ ddlmZ G dd� de�ZG dd� 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)�Parentedc sD e Zd ZdZ� fdd�Zdd� Zdd� Zdd � Zed
d� �Z � Z
S )�InlineShapeszYSequence of |InlineShape| instances, supporting len(), iteration, and indexed
access.c s t t| ��|� || _d S �N)�superr �__init__�_body)�self�body_elm�parent�� __class__� �C/home/arjun/projects/env/lib/python3.10/site-packages/docx/shape.pyr s
zInlineShapes.__init__c C s4 z
| j | }W t|�S ty d| }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�msgr r r �__getitem__ s ��zInlineShapes.__getitem__c C s dd� | j D �S )Nc s s � | ]}t |�V qd S r )r )�.0r r r r � <genexpr> s � z(InlineShapes.__iter__.<locals>.<genexpr>)r �r
r r r �__iter__ s zInlineShapes.__iter__c C s
t | j�S r )�lenr r r r r �__len__ s
zInlineShapes.__len__c C s | j }d}|�|�S )Nz//w:p/w:r/w:drawing/wp:inline)r �xpath)r
�bodyr r r r r "