B
    S                 @   s4   d Z ddlmZmZmZ G dd deZdd ZdS )z 
Objects shared by opc modules.
    )absolute_importprint_functionunicode_literalsc                   s8   e Zd ZdZ fddZ fddZ fddZ  ZS )CaseInsensitiveDictaP  
    Mapping type that behaves like dict except that it matches without respect
    to the case of the key. E.g. cid['A'] == cid['a']. Note this is not
    general-purpose, just complete enough to satisfy opc package needs. It
    assumes str keys, and that it is created empty; keys passed in constructor
    are not accounted for
    c                s   t t| | S )N)superr   __contains__lower)selfkey)	__class__ A/var/www/html/venv/lib/python3.7/site-packages/docx/opc/shared.pyr      s    z CaseInsensitiveDict.__contains__c                s   t t| | S )N)r   r   __getitem__r   )r	   r
   )r   r   r   r      s    zCaseInsensitiveDict.__getitem__c                s   t t| | |S )N)r   r   __setitem__r   )r	   r
   value)r   r   r   r      s    
zCaseInsensitiveDict.__setitem__)__name__
__module____qualname____doc__r   r   r   __classcell__r   r   )r   r   r   
   s   r   c                s*   dj   j} fdd}t||dS )z
    @lazyprop decorator. Decorated method will be called only on first access
    to calculate a cached property value. After that, the cached value is
    returned.
    z_%sc                s8   y
t |  S  tk
r2   | }t|  | |S X d S )N)getattrAttributeErrorsetattr)objr   )cache_attr_namefr   r   get_prop_value'   s    
z$lazyproperty.<locals>.get_prop_value)doc)r   r   property)r   Z	docstringr   r   )r   r   r   lazyproperty   s    
r   N)r   
__future__r   r   r   dictr   r   r   r   r   r   <module>   s   