B
    P•\×  ã               @   s8   d dl mZ d dlmZ d dlmZ G dd„ deƒZdS )é    )Úabsolute_import)Ú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	   ú4lib/python3.7/site-packages/openpyxl/styles/proxy.pyÚ__init__   s    zStyleProxy.__init__c             C   s
   t | jƒS )N)Úreprr   )r   r	   r	   r
   Ú__repr__   s    zStyleProxy.__repr__c             C   s   t | j|ƒS )N)Ú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   s0   t | jƒ}x | ¡ D ]\}}t|||ƒ qW |S )zHReturn a copy of the proxied object. Keyword args will be passed through)r   r   ÚitemsÚsetattr)r   ÚkwZcpÚkÚvr	   r	   r
   r   1   s    
zStyleProxy.copyc             C   s
   | j |kS )N)r   )r   r   r	   r	   r
   Ú__eq__:   s    zStyleProxy.__eq__c             C   s
   | |k S )Nr	   )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)Z
__future__r   r   Zopenpyxl.compatr   Úobjectr   r	   r	   r	   r
   Ú<module>   s   