
    >h                    j    d Z ddlmZ ddlmZ ddlmZ ddlmZ erddl	m
Z ddlmZ  G d d	e      Zy)
z1DrawingML-related objects are in this subpackage.    )annotations)TYPE_CHECKING)
CT_Drawing)ParentedN)Imagec                  H     e Zd ZdZd fdZedd       Zedd       Z xZS )Drawingz!Container for a DrawingML object.c                N    t         |   |       || _        |x| _        | _        y )N)super__init___parent_drawing_element)selfdrawingparent	__class__s      V/var/www/html/bid_assistant/venv/lib/python3.12/site-packages/docx/drawing/__init__.pyr   zDrawing.__init__   s%     (//    c                N    d}t        | j                  j                  |            S )a  True when `drawing` contains an embedded picture.

        A drawing can contain a picture, but it can also contain a chart, SmartArt, or a
        drawing canvas. Methods related to a picture, like `.image`, will raise when the drawing
        does not contain a picture. Use this value to determine whether image methods will succeed.

        This value is `False` when a linked picture is present. This should be relatively rare and
        the image would only be retrievable from the filesystem.

        Note this does not distinguish between inline and floating images. The presence of either
        one will cause this value to be `True`.
        zY./wp:inline/a:graphic/a:graphicData/pic:pic | ./wp:anchor/a:graphic/a:graphicData/pic:pic)boolr   xpath)r   
xpath_exprs     r   has_picturezDrawing.has_picture   s(     = 	 DMM''
344r   c                    | j                   j                  d      }|st        d      |d   }| j                  }|j                  |   }|j
                  S )zAn `Image` proxy object for the image in this (picture) drawing.

        Raises `ValueError` when this drawing does contains something other than a picture. Use
        `.has_picture` to qualify drawing objects before using this property.
        z.//pic:blipFill/a:blip/@r:embedz"drawing does not contain a picturer   )r   r   
ValueErrorpartrelated_partsimage)r   picture_rIdsrIddoc_part
image_parts        r   r   zDrawing.image.   sV     }}**+LMABB1o99++C0
r   )r   r   r   zt.ProvidesStoryPart)returnr   )r$   r   )	__name__
__module____qualname____doc__r   propertyr   r   __classcell__)r   s   @r   r	   r	      s3    +0
 5 5,    r   r	   )r(   
__future__r   typingr   docx.oxml.drawingr   docx.sharedr   
docx.typestypestdocx.image.imager   r	    r   r   <module>r4      s)    7 "   (  &, h , r   