o
    ýÞh­  ã                   @  s|   d Z ddlmZ ddl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 G d	d
„ d
eƒZG dd„ deƒZdS )zHeader and footer part objects.é    )ÚannotationsN)ÚTYPE_CHECKING)ÚCONTENT_TYPE)Ú	parse_xml)Ú	StoryPart)ÚPackagec                   @  ó*   e Zd ZdZed	dd„ƒZedd„ ƒZdS )
Ú
FooterPartzDefinition of a section footer.Úpackager   c                 C  ó*   |  d¡}tj}t|  ¡ ƒ}| ||||ƒS )z!Return newly created footer part.z/word/footer%d.xml)Únext_partnameÚCTÚ
WML_FOOTERr   Ú_default_footer_xml©Úclsr
   ÚpartnameÚcontent_typeÚelement© r   úQ/var/www/html/premium_crap/venv/lib/python3.10/site-packages/docx/parts/hdrftr.pyÚnew   ó   
zFooterPart.newc                 C  óV   t j t j t¡d ddd¡}t|dƒ�}| ¡ }W d  ƒ |S 1 s$w   Y  |S )z6Return bytes containing XML for a default footer part.r   ú..Ú	templateszdefault-footer.xmlÚrbN©ÚosÚpathÚjoinÚsplitÚ__file__ÚopenÚread©r   r   ÚfÚ	xml_bytesr   r   r   r      ó   

ÿþzFooterPart._default_footer_xmlN©r
   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úclassmethodr   r   r   r   r   r   r	      ó    r	   c                   @  r   )
Ú
HeaderPartzDefinition of a section header.r
   r   c                 C  r   )z!Return newly created header part.z/word/header%d.xml)r   r   Ú
WML_HEADERr   Ú_default_header_xmlr   r   r   r   r   '   r   zHeaderPart.newc                 C  r   )z6Return bytes containing XML for a default header part.r   r   r   zdefault-header.xmlr   Nr   r%   r   r   r   r2   /   r(   zHeaderPart._default_header_xmlNr)   )r*   r+   r,   r-   r.   r   r2   r   r   r   r   r0   $   r/   r0   )r-   Ú
__future__r   r   Útypingr   Údocx.opc.constantsr   r   Údocx.oxml.parserr   Údocx.parts.storyr   Údocx.packager   r	   r0   r   r   r   r   Ú<module>   s    