a
    «Á‚b°  ã                   @   s,   d dl m Z  d dlmZ G dd„ deƒZdS )é    )Úcopy)Ú
deprecatedc                       sl   e Zd ZdZdZdd„ Zdd„ Zdd„ Z‡ fd	d
„Zdd„ Z	dd„ Z
edƒdd„ ƒZdd„ Zdd„ Z‡  ZS )Ú
StyleProxyzA
    Proxy formatting objects so that they cannot be altered
    Z__targetc                 C   s
   || _ d S ©N©Ú_StyleProxy__target)ÚselfÚtarget© r
   úe/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/openpyxl/styles/proxy.pyÚ__init__   s    zStyleProxy.__init__c                 C   s
   t | jƒS r   )Úreprr   ©r   r
   r
   r   Ú__repr__   s    zStyleProxy.__repr__c                 C   s   t | j|ƒS r   )Úgetattrr   )r   Úattrr
   r
   r   Ú__getattr__   s    zStyleProxy.__getattr__c                    s&   |dkrt dƒ‚tt| ƒ ||¡ d S )Nr   zPStyle objects are immutable and cannot be changed.Reassign the style with a copy)ÚAttributeErrorÚsuperr   Ú__setattr__)r   r   Úvalue©Ú	__class__r
   r   r      s    zStyleProxy.__setattr__c                 C   s
   t | jƒS )z6
        Return a copy of the proxied object.
        )r   r   r   r
   r
   r   Ú__copy__"   s    zStyleProxy.__copy__c                 C   s
   | j | S )zW
        Add proxied object to another instance and return the combined object
        r   ©r   Úotherr
   r
   r   Ú__add__)   s    zStyleProxy.__add__z,Use copy(obj) or cell.obj = cell.obj + otherc                 K   s,   t | jƒ}| ¡ D ]\}}t|||ƒ q|S )zHReturn a copy of the proxied object. Keyword args will be passed through)r   r   ÚitemsÚsetattr)r   ÚkwÚcpÚkÚvr
   r
   r   r   0   s    
zStyleProxy.copyc                 C   s
   | j |kS r   r   r   r
   r
   r   Ú__eq__9   s    zStyleProxy.__eq__c                 C   s
   | |k S r   r
   r   r
   r
   r   Ú__ne__=   s    zStyleProxy.__ne__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__r   r   r   r   r   r   r   r   r#   r$   Ú__classcell__r
   r
   r   r   r      s   
r   N)r   Zopenpyxl.compatr   Úobjectr   r
   r
   r
   r   Ú<module>   s   