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/lib/python3.10/site-packages/docx/__pycache__/api.cpython-310.pyc
o

$we��@sTdZddlmZddlZddlmZddlmZddl	m
Z
d
dd	d
�Zdd�ZdS)z�Directly exposed API functions and classes, :func:`Document` for now.

Provides a syntactically more convenient API for interacting with the OpcPackage graph.
�)�annotationsN)�IO)�CONTENT_TYPE)�Package�docx�str | IO[bytes] | NonecCsF|durt�n|}t�|�j}|jtjkr d}t|||jf��|jS)z�Return a |Document| object loaded from `docx`, where `docx` can be either a path
    to a ``.docx`` file (a string) or a file-like object.

    If `docx` is missing or ``None``, the built-in default document "template" is
    loaded.
    Nz2file '%s' is not a Word file, content type is '%s')	�_default_docx_pathr�open�main_document_part�content_type�CT�WML_DOCUMENT_MAIN�
ValueError�document)r�
document_part�tmpl�r�A/home/arjun/projects/env/lib/python3.10/site-packages/docx/api.py�DocumentsrcCs tj�t�d}tj�|dd�S)z6Return the path to the built-in default .docx package.r�	templateszdefault.docx)�os�path�split�__file__�join)�_thisdirrrrrsr)N)rr)
�__doc__�
__future__rr�typingr�docx.opc.constantsrr�docx.packagerrrrrrr�<module>s