B
    P\                 @   s    d dl mZ G dd deZdS )    )absolute_importc               @   sh   e Zd ZdZdddZedd Zdd	 Zd
d Zdd Z	dd Z
dd Zedd Zejdd ZdS )CommentNO      c             C   s   || _ || _|| _|| _d S )N)contentauthorheightwidth)selftextr   r   r	    r   9lib/python3.7/site-packages/openpyxl/comments/comments.py__init__   s    zComment.__init__c             C   s   | j S )N)_parent)r
   r   r   r   parent   s    zComment.parentc             C   s   | j |j ko| j|jkS )N)r   r   )r
   otherr   r   r   __eq__   s    zComment.__eq__c             C   s   d | j| jS )NzComment: {0} by {1})formatr   r   )r
   r   r   r   __repr__   s    zComment.__repr__c             C   s   |  | j| j| j| j}|S )z'Create a detached copy of this comment.)	__class__r   r   r   r	   )r
   Zcloner   r   r   __copy__   s    zComment.__copy__c             C   s@   |dk	r6| j dk	r6| j |kr6d}t||j|jj|| _ dS )z3
        Bind comment to a particular cell
        Nz_Comment already assigned to {0} in worksheet {1}. Cannot assign a comment to more than one cell)r   AttributeErrorr   Z
coordinater   title)r
   ZcellZfmtr   r   r   bind$   s    zComment.bindc             C   s
   d| _ dS )z.
        Unbind a comment from a cell
        N)r   )r
   r   r   r   unbind.   s    zComment.unbindc             C   s   | j S )z>
        Any comment text stripped of all formatting.
        )r   )r
   r   r   r   r   5   s    zComment.textc             C   s
   || _ d S )N)r   )r
   valuer   r   r   r   <   s    )r   r   )__name__
__module____qualname__r   r   propertyr   r   r   r   r   r   r   setterr   r   r   r   r      s   

r   N)Z
__future__r   objectr   r   r   r   r   <module>   s   