o
    7 ¾hÉ  ã                   @  s€   d Z ddlmZ ddlZddlmZmZ ddlmZ	 ddl
mZ er.ddlmZ ddlmZ dddd„Zddd„Zddd„ZdS )a  Directly exposed API classes, Presentation for now.

Provides some syntactic sugar for interacting with the pptx.presentation.Package graph and also
provides some insulation so not so many classes in the other modules need to be named as internal
(leading underscore).
é    )ÚannotationsN)ÚIOÚTYPE_CHECKING)ÚCONTENT_TYPE)ÚPackage)Úpresentation)ÚPresentationPartÚpptxústr | IO[bytes] | NoneÚreturnúpresentation.Presentationc                 C  s>   | du rt ƒ } t | ¡j}t|ƒsd}t|| |jf ƒ‚|jS )zú
    Return a |Presentation| object loaded from *pptx*, where *pptx* can be
    either a path to a ``.pptx`` file (a string) or a file-like object. If
    *pptx* is missing or ``None``, the built-in default presentation
    "template" is loaded.
    Nz8file '%s' is not a PowerPoint file, content type is '%s')Ú_default_pptx_pathr   ÚopenZmain_document_partÚ_is_pptx_packageÚ
ValueErrorÚcontent_typer   )r	   Zpresentation_partÚtmpl© r   úP/var/www/html/figdemos/bartoux_crm/venv/lib/python3.10/site-packages/pptx/api.pyÚPresentation   s   r   Ústrc                  C  s    t j t¡d } t j | dd¡S )z6Return the path to the built-in default .pptx package.r   Ú	templateszdefault.pptx)ÚosÚpathÚsplitÚ__file__Újoin)Z_thisdirr   r   r   r   (   s   r   Úprs_partr   c                 C  s   t jt jf}| j|v S )zMReturn |True| if *prs_part* is a valid main document part, |False| otherwise.)ÚCTÚPML_PRESENTATION_MAINÚPML_PRES_MACRO_MAINr   )r   Zvalid_content_typesr   r   r   r   .   s   
r   )N)r	   r
   r   r   )r   r   )r   r   )Ú__doc__Ú
__future__r   r   Útypingr   r   Úpptx.opc.constantsr   r   Zpptx.packager   r	   r   Úpptx.parts.presentationr   r   r   r   r   r   r   r   Ú<module>   s    
