a
    b	                     @   s  d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZ G dd	 d	eZG d
d deZG dd de	Ze
ZG dd de	ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdddZdS ) z
Excel specific descriptors
    )REL_NS)safe_string)Element   )MatchPatternMinMaxIntegerStringSequence)Serialisablec                   @   s   e Zd ZdZdS )	HexBinaryz[0-9a-fA-F]+$N__name__
__module____qualname__pattern r   r   j/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/openpyxl/descriptors/excel.pyr      s   r   c                   @   s   e Zd ZdZdS )UniversalMeasurez$[0-9]+(\.[0-9]+)?(mm|cm|in|pt|pc|pi)Nr   r   r   r   r   r      s   r   c                   @   s   e Zd ZdZeZdZdZdS )	TextPointzt
    Size in hundredths of points.
    In theory other units of measurement can be used but these are unbounded
    ii N)r   r   r   __doc__intexpected_typeminmaxr   r   r   r   r      s   r   c                       s(   e Zd ZdZdZdZ fddZ  ZS )
Percentagez&((100)|([0-9][0-9]?))(\.[0-9][0-9]?)?%ii@B c                    sD   t |tr.d|v r.|dd}tt|d }tt| || d S )N% i  )
isinstancestrreplacer   floatsuperr   __set__selfinstancevalue	__class__r   r   r#   3   s    zPercentage.__set__)r   r   r   r   r   r   r#   __classcell__r   r   r(   r   r   -   s   r   c                   @   s   e Zd Ze ZdddZdS )	ExtensionNc                 C   s
   || _ d S N)uri)r%   r-   r   r   r   __init__>   s    zExtension.__init__)N)r   r   r   r	   r-   r.   r   r   r   r   r+   :   s    r+   c                   @   s    e Zd ZeedZdddZdS )ExtensionList)r   r   c                 C   s
   || _ d S r,   )ext)r%   r0   r   r   r   r.   H   s    zExtensionList.__init__N)r   )r   r   r   r
   r+   r0   r.   r   r   r   r   r/   D   s   
 r/   c                   @   s   e Zd ZeZdZdS )RelationTN)r   r   r   r   	namespace
allow_noner   r   r   r   r1   N   s   r1   c                   @   s   e Zd ZdZdS )Base64BinaryzP^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$Nr   r   r   r   r   r4   T   s   r4   c                   @   s   e Zd ZdZdS )Guidz?{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}Nr   r   r   r   r   r5   Y   s   r5   c                       s$   e Zd ZdZdZ fddZ  ZS )	CellRangez]^[$]?([A-Za-z]{1,3})[$]?(\d+)(:[$]?([A-Za-z]{1,3})[$]?(\d+)?)?$|^[A-Za-z]{1,3}:[A-Za-z]{1,3}$Tc                    s&   |d ur|  }tt| || d S r,   )upperr"   r6   r#   r$   r(   r   r   r#   c   s    zCellRange.__set__)r   r   r   r   r3   r#   r*   r   r   r(   r   r6   ^   s   r6   Nc                 C   s$   |durd|| f } t | t|dS )z?
    Override serialisation because explicit none required
    Nz{%s}%s)val)r   r   )tagnamer'   r2   r   r   r   _explicit_nonej   s    r:   )N)r   Zopenpyxl.xml.constantsr   Zopenpyxl.compatr   Zopenpyxl.xml.functionsr   r   r   r   r   r	   r
   Zserialisabler   r   r   r   Z
Coordinater   r+   r/   r1   r4   r5   r6   r:   r   r   r   r   <module>   s"   

