
     ho                         d Z ddlZddlZddlZddlZddlZddlZ G d d      Z ej                  d      j                  Zd Zd Zd Zd	 Zd
 Z ej                  dej"                        j$                  Zd Zd Zy)zcssutils helper TEST    Nc                       e Zd ZdZd Zd Zy)
Deprecateda.  This is a decorator which can be used to mark functions
    as deprecated. It will result in a warning being emitted
    when the function is used.

    It accepts a single paramter ``msg`` which is shown with the warning.
    It should contain information which function or method to use instead.
    c                     || _         y )N)msg)selfr   s     O/var/www/api/v1/venv_getwork_v1/lib/python3.12/site-packages/cssutils/helper.py__init__zDeprecated.__init__   s	        c                       fd}j                   |_         j                  |_        |j                  j                  j                         |S )Nc                      dd l }|j                  dj                  dj                   t        d        | i |S )Nr   zCall to deprecated method z.    )category
stacklevel)warningswarn__name__r   DeprecationWarning)argskwargsr   funcr   s      r   newFuncz$Deprecated.__call__.<locals>.newFunc   sH    MM,T]],=RzJ+  
 (((r
   )r   __doc____dict__update)r   r   r   s   `` r   __call__zDeprecated.__call__   s>    	)  ==,,.r
   N)r   
__module____qualname__r   r	   r    r
   r   r   r      s    r
   r   z(\\[^0-9a-fA-F])c                 H    | rd }t        ||       } | j                         S | S )z
    normalizes x, namely:

    - remove any \ before non unicode sequences (0-9a-zA-Z) so for
      x==r"c\olor\" return "color" (unicode escape sequences should have
      been resolved by the tokenizer already)
    - lowercase
    c                 *    | j                  d      dd  S )Nr      )group)matchobjs    r   removeescapeznormalize.<locals>.removeescape7   s    >>!$QR((r
   )_simpleescapeslower)xr$   s     r   	normalizer(   ,   s+     		) <+wwyr
   c                     dt         j                  j                  t        j                  j                  |             z   S )zReturn file URL of `path`zfile:)urllibrequestpathname2urlospathabspath)r.   s    r   path2urlr0   @   s)    V^^001FGGGr
   c                 0    t        j                  | g|      S )zQReturn new generator starting with token followed by all tokens in
    ``tokens``)	itertoolschain)tokentokenss     r   	pushtokenr6   E   s     ??E7F++r
   c                     | j                  dd      j                  dd      j                  dd      j                  dd      } | j                  d	      r| d
d dz   } d| z  S )zV
    Serialize value with quotes e.g.::

        ``a 'string`` => ``'a 'string'``
    
z\a z\d z\c "z\"\Nz\\z"%s")replaceendswithvalues    r   stringrB   K   sc     	dF#	v		v		e		 
 ~~dcr
V#E>r
   c                 >    | j                  d| d   z   | d         dd S )z
    Retrieve actual value of string without quotes. Escaped
    quotes inside the value are resolved, e.g.::

        ``'a 'string'`` => ``a 'string``
    r<   r   r!   r=   )r>   )rB   s    r   stringvaluerD   _   s)     >>$*F1I6q<<r
   z.*?[\(\)\s\;,'"]c                 8    t        |       rt        |       } d| z  S )zm
    Serialize value by adding ``url()`` and with quotes if needed e.g.::

        ``"`` => ``url(""")``
    zurl(%s))_match_forbidden_in_urirB   r@   s    r   urirG   l   s      u%uur
   c                     | | j                  d      dz   d j                         } | r| d   dv r| d   | d   k(  rt        |       S | S )z
    Return actual content without surrounding "url(" and ")"
    and removed surrounding quotes too including contained
    escapes of quotes, e.g.::

         ``url(""")`` => ``"``
    (r!   r=   r   z'")findstriprD   )rG   s    r   urivaluerL   w   sR     chhsma"
%
+
+
-C
A%c!fB&73
r
   )r   r2   r-   reurllib.errorr*   urllib.parseurllib.requestr   compilesubr%   r(   r0   r6   rB   rD   UmatchrF   rG   rL   r   r
   r   <module>rU      s      	 	    < /044(H
,(= %"**%<bddCII r
   