File: //home/arjun/projects/env/lib64/python3.10/site-packages/docx/__pycache__/package.cpython-310.pyc
o
$we � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl
mZ ddlm
Z
ddlmZ dd lmZ G d
d� de�ZG dd
� d
�ZdS )z3WordprocessingML Package class and related objects.� )�annotations)�IO)�Image)�RELATIONSHIP_TYPE)�
OpcPackage��PackURI)� ImagePart)�lazypropertyc @ s8 e Zd ZdZdd� Zddd �Zeddd��Zd
d� ZdS )�Packagez6Customizations specific to a WordprocessingML package.c C s | � � dS )z�Called by loading code after all parts and relationships have been loaded.
This method affords the opportunity for any required post-processing.
N)�_gather_image_parts��self� r �E/home/arjun/projects/env/lib/python3.10/site-packages/docx/package.py�after_unmarshal s zPackage.after_unmarshal�image_descriptor�str | IO[bytes]�returnr c C � | j �|�S )z�Return |ImagePart| containing image specified by `image_descriptor`.
The image-part is newly created if a matching one is not already present in the
collection.
)�image_parts�get_or_add_image_part)r r r r r r s zPackage.get_or_add_image_part�
ImagePartsc C s t � S )z0|ImageParts| collection object for this package.)r r
r r r r ! s zPackage.image_partsc C sD | � � D ]}|jr
q|jtjkrq|j| jv rq| j�|j� qdS )zCLoad the image part collection with all the image parts in package.N)� iter_rels�is_external�reltype�RT�IMAGE�target_partr �append)r �relr r r r &