
    Nqh`
                     h   d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
mZ ddlmZ ddlmZ ddlmZmZmZ  G d de      Z G d	 d
ee      Z G d de      Z G d dee      Z G d dee	      Z G d dee
      Z G d dee      Z G d dee      Z G d dee      Z G d dee      Z G d dee      Zy)z
Generic serialisable classes
   )
ConvertibleBool
DescriptorNoneSetMinMaxSetFloatIntegerStringText)Sequence    )safe_string)Element	localname
whitespacec                   4     e Zd ZdZdZ fdZd ZddZ xZS )NestedTvalc                     t        |d      r6t        |      }|| j                  k7  rt        d      | j	                  |      }t
        t        |   ||       y )NtagzTag does not match attribute)hasattrr   name
ValueError	from_treesuperr   __set__)selfinstancevaluer   	__class__s       \/srv/www/ollama/chat-ollama/venv/lib/python3.12/site-packages/openpyxl/descriptors/nested.pyr   zNested.__set__   sN    5% E"Cdii !?@@NN5)Efd#He4    c                 8    |j                  | j                        S N)get	attributer   nodes     r"   r   zNested.from_tree&   s    xx''r#   c                 |    t        | d|      }|-|d|d|}t        |      }t        || j                  |i      S y N	namespace{})getattrr   r   r'   r   tagnamer    r,   s       r"   to_treezNested.to_tree*   sK    D+y9	$&/9&E7T^^E$:;;	 r#   NNN)	__name__
__module____qualname__nestedr'   r   r   r2   __classcell__)r!   s   @r"   r   r      s    FI5(<r#   r   c                       e Zd ZdZy)NestedValuez=
    Nested tag storing the value on the 'val' attribute
    N)r4   r5   r6   __doc__ r#   r"   r:   r:   3   s     	r#   r:   c                       e Zd ZdZd ZddZy)
NestedTextzM
    Represents any nested tag with the value as the contents of the tag
    c                     |j                   S r%   )textr(   s     r"   r   zNestedText.from_tree@   s    yyr#   Nc                     t        | d|      }|2|d|d|}t        |      }t        |      |_        t	        |       |S y r+   )r/   r   r   r@   r   )r   r1   r    r,   els        r"   r2   zNestedText.to_treeD   sM    D+y9	$&/9!B!%(BGrNI r#   r3   r4   r5   r6   r;   r   r2   r<   r#   r"   r>   r>   :   s    
r#   r>   c                       e Zd Zy)NestedFloatNr4   r5   r6   r<   r#   r"   rE   rE   O       r#   rE   c                       e Zd Zy)NestedIntegerNrF   r<   r#   r"   rI   rI   T   rG   r#   rI   c                       e Zd Zy)NestedStringNrF   r<   r#   r"   rK   rK   Y   rG   r#   rK   c                       e Zd Zd Zy)
NestedBoolc                 &    |j                  dd      S )Nr   T)r&   r(   s     r"   r   zNestedBool.from_treea   s    xxt$$r#   N)r4   r5   r6   r   r<   r#   r"   rM   rM   ^   s    %r#   rM   c                       e Zd Zy)NestedNoneSetNrF   r<   r#   r"   rP   rP   e   rG   r#   rP   c                       e Zd Zy)	NestedSetNrF   r<   r#   r"   rR   rR   j   rG   r#   rR   c                       e Zd Zy)NestedMinMaxNrF   r<   r#   r"   rT   rT   o   rG   r#   rT   c                       e Zd ZdZd ZddZy)EmptyTagz)
    Boolean if a tag exists or not.
    c                      y)NTr<   r(   s     r"   r   zEmptyTag.from_treez   s    r#   Nc                 L    |r"t        | d|      }|d|d|}t        |      S y r+   )r/   r   r0   s       r"   r2   zEmptyTag.to_tree~   s3    k9=I$&/97##	 r#   r3   rC   r<   r#   r"   rV   rV   t   s    $r#   rV   N)r;   baser   r   r   r   r   r   r	   r
   r   r   sequencer   openpyxl.compatr   openpyxl.xml.functionsr   r   r   r   r:   r>   rE   rI   rK   rM   rP   rR   rT   rV   r<   r#   r"   <module>r]      s       ' A A<Z <8	&+ 	 *	+u 	
	K 	
	; 	
%d %	FG 	
	 	
	66 	
$vt $r#   