
    rbix                    T   d Z ddlmZ ddlmZmZmZmZmZ ddl	m
Z
 ddlZddlZddlZ ede
def                   Z ed	d
          Zeeeeeef         ef                  ZeefZdddZddZ G d d
eeef         ej                  Zedk    rddlZ ej                     dS dS )zThis module contains miscellaneous helpers.

It is not considered part of the public ufoLib API. It does, however,
define the :py:obj:`.deprecated` decorator that is used elsewhere in
the module.
    )annotations)OptionalTypeTypeVarUnioncast)CallableNF.)boundFormatVersionBaseFormatVersion msgstrreturnCallable[[F], F]c                     d fd}|S )a@  Decorator factory to mark functions as deprecated with given message.

    >>> @deprecated("Enough!")
    ... def some_function():
    ...    "I just print 'hello world'."
    ...    print("hello world")
    >>> some_function()
    hello world
    >>> some_function.__doc__ == "I just print 'hello world'."
    True
    funcr
   r   c                p     t          j                    fd            }t          t          |          S )Nc                 `    t          j        j         d t          d            | i |S )Nz function is a deprecated.    )category
stacklevel)warningswarn__name__DeprecationWarning)argskwargsr   r   s     f/var/www/html/mdtn/previsions/meteo_cartes/venv/lib/python3.11/site-packages/fontTools/ufoLib/utils.pywrapperz9deprecated.<locals>.deprecated_decorator.<locals>.wrapper%   sL    M=BBSBB+   
 4((((    )	functoolswrapsr   r
   )r   r!   r   s   ` r    deprecated_decoratorz(deprecated.<locals>.deprecated_decorator$   sI    				) 	) 	) 	) 	) 
		) Awr"   )r   r
   r   r
    )r   r%   s   ` r    
deprecatedr'      s)    
  
  
  
  
  
   r"   valueFormatVersionInputclsType[FormatVersion]c                    | |                                 S t          | |          r| S t          | t                    r || df          S t          | t                    rt	          |           dk    r ||           S t          d|           )Nr   r   zUnsupported format version: )default
isinstanceinttuplelen
ValueError)r(   r*   s     r    normalizeFormatVersionr3   3   s     }{{}}% % sE1:% CJJ!OOs5zz
=E==
>
>>r"   c                       e Zd ZU ded<   d fdZedd            Zedd	            Zedd            Z	ddZ
edd            Zedd            Z xZS )r   tuple[int, int]r(   r*   r+   r   c                H    t                                          | |          S N)super__new__)r*   r(   	__class__s     r    r9   zBaseFormatVersion.__new__F   s    wwsE***r"   r/   c                    | j         d         S )Nr   r(   selfs    r    majorzBaseFormatVersion.majorI       z!}r"   c                    | j         d         S )N   r<   r=   s    r    minorzBaseFormatVersion.minorM   r@   r"   objectc                    t          |t                    r | |df          S ||                                 S t          |d| j                   )Nr   z is not a valid )r.   r/   r-   r2   r   )r*   r(   s     r    	_missing_zBaseFormatVersion._missing_Q   sY     eS!! 	#3qz??"=;;== ECCS\CCDDDr"   r   c                $    | j          d| j         S )N.)r?   rC   r=   s    r    __str__zBaseFormatVersion.__str__[   s    *++tz+++r"   r   c                N    t          | j                                                  S r7   )max__members__valuesr*   s    r    r-   zBaseFormatVersion.default^   s      3?))++,,,r"   frozenset[FormatVersion]c                N    t          | j                                                  S r7   )	frozensetrL   rM   rN   s    r    supported_versionsz$BaseFormatVersion.supported_versionsc   s    //11222r"   )r*   r+   r(   r5   r   r   )r   r/   )r(   rD   r   r   )r   r   )r*   r+   r   r   )r*   r+   r   rO   )r   
__module____qualname____annotations__r9   propertyr?   rC   classmethodrF   rI   r-   rR   __classcell__)r:   s   @r    r   r   C   s        + + + + + +    X    X E E E [E, , , , - - - [- 3 3 3 [3 3 3 3 3r"   __main__)r   )r   r   r   r   )r(   r)   r*   r+   r   r   )__doc__
__future__r   typingr   r   r   r   r   collections.abcr	   enumr#   r   rD   r
   r   r/   r0   r)   floatnumberTypesr'   r3   Enumr   r   doctesttestmodr&   r"   r    <module>rd      so    # " " " " " 7 7 7 7 7 7 7 7 7 7 7 7 7 7 $ $ $ $ $ $      GCxV,---/BCCCeCsCx-$GHI El         8? ? ? ? "3 "3 "3 "3 "3c3h "3 "3 "3J zNNNGO r"   