§ ¼÷;iFãóv—dZddlmZddlZddlmZmZmZddlm Z ddl m Z er ddl mZddlmZddd „Zd„ZdS)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Ú TYPE_CHECKINGÚcast)Ú CONTENT_TYPE)ÚPackage)ÚDocument)Ú DocumentPartÚdocxústr | IO[bytes] | NoneÚreturnÚDocumentObjectcóâ—|€t¦«n|}tdtj|¦«j¦«}|jt jkrd}t|||jfz¦«‚|j S)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. Nr z2file '%s' is not a Word file, content type is '%s') Ú_default_docx_pathrrÚopenÚmain_document_partÚ content_typeÚCTÚWML_DOCUMENT_MAINÚ ValueErrorÚdocument)r Ú document_partÚtmpls úÔ >Ð>r)N)r r r r)Ú__doc__Ú __future__rrÚtypingrrrÚdocx.opc.constantsrrÚ docx.packagerÚ docx.documentr rÚdocx.parts.documentr r©rrúr,sÌðððð #Ð"Ð"Ð"Ð"Ð"à € € € Ø*Ð*Ð*Ð*Ð*Ð*Ð*Ð*Ð*Ð*à1Ð1Ð1Ð1Ð1Ð1Ø Ð Ð Ð Ð Ð àð1Ø8Ð8Ð8Ð8Ð8Ð8Ø0Ð0Ð0Ð0Ð0Ð0ð "ð "ð "ð "ð "ð?ð?ð?ð?ð?r