a
    ]j                     @  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
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ erdd	lmZ ddlmZ G dd deZdS )z(Contains comments added to the document.    )annotationsN)TYPE_CHECKINGcast)Self)Comments)CONTENT_TYPE)PackURI)CT_Comments)	parse_xml)Package)	StoryPartc                      sd   e Zd ZdZddddd fddZed	d
ddZedddddZedd
ddZ	  Z
S )CommentsPartz2Container part for comments added to the document.r   strr	   r   )partnamecontent_typeelementpackagec                   s   t  |||| || _d S )N)super__init__	_comments)selfr   r   r   r   	__class__ O/var/www/html/assistant/venv/lib/python3.9/site-packages/docx/parts/comments.pyr      s    zCommentsPart.__init__r   )returnc                 C  s   t | j| S )zIA |Comments| proxy object for the `w:comments` root element of this part.)r   r   )r   r   r   r   comments    s    zCommentsPart.commentsr   )r   r   c                 C  s.   t d}tj}tdt|  }| ||||S )zOA newly created comments part, containing a default empty `w:comments` element.z/word/comments.xmlr	   )r   CTZWML_COMMENTSr   r
   _default_comments_xml)clsr   r   r   r   r   r   r   default%   s    zCommentsPart.defaultbytesc                 C  sT   t jt jtd ddd}t|d}| }W d   n1 sF0    Y  |S )z9A byte-string containing XML for a default comments part.r   z..Z	templateszdefault-comments.xmlrbN)ospathjoinsplit__file__openread)r   r$   fZ	xml_bytesr   r   r   r   -   s    &z"CommentsPart._default_comments_xml)__name__
__module____qualname____doc__r   propertyr   classmethodr    r   __classcell__r   r   r   r   r      s   r   )r.   
__future__r   r#   typingr   r   Ztyping_extensionsr   Zdocx.commentsr   Zdocx.opc.constantsr   r   Zdocx.opc.packurir   Zdocx.oxml.commentsr	   Zdocx.oxml.parserr
   Zdocx.packager   Zdocx.parts.storyr   r   r   r   r   r   <module>   s   