
    Whx                    8   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j0                        Zedk(  rddlZ ej8                          yy)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BaseFormatVersionc                     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
    c                b     t        j                          fd       }t        t        |      S )Nc                 j    t        j                  j                   d t        d        | i |S )Nz function is a deprecated.    )category
stacklevel)warningswarn__name__DeprecationWarning)argskwargsfuncmsgs     P/var/www/html/jupyter_env/lib/python3.12/site-packages/fontTools/ufoLib/utils.pywrapperz9deprecated.<locals>.deprecated_decorator.<locals>.wrapper%   s:    MM==/!<SEB+
 (((    )	functoolswrapsr   r
   )r   r   r   s   ` r   deprecated_decoratorz(deprecated.<locals>.deprecated_decorator$   s-    			) 
	) Awr   )r   r
   returnr
    )r   r!   s   ` r   
deprecatedr$      s    
   r   c                    | |j                         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)valueclss     r   normalizeFormatVersionr.   3   sm     }{{}%%E1:%CJ!O5z
3E9=
>>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,   c                $    t         |   | |      S N)super__new__)r-   r,   	__class__s     r   r4   zBaseFormatVersion.__new__F   s    wsE**r   c                     | j                   d   S )Nr   r,   selfs    r   majorzBaseFormatVersion.majorI       zz!}r   c                     | j                   d   S )N   r7   r8   s    r   minorzBaseFormatVersion.minorM   r;   r   c                    t        |t              r
 | |df      S || j                         S t        |d| j                         )Nr   z is not a valid )r'   r(   r&   r+   r   )r-   r,   s     r   	_missing_zBaseFormatVersion._missing_Q   sH     eS!qz?"=;;= E9$4S\\NCDDr   c                8    | j                    d| j                   S )N.)r:   r>   r8   s    r   __str__zBaseFormatVersion.__str__[   s    **Qtzzl++r   c                H    t        | j                  j                               S r2   )max__members__valuesr-   s    r   r&   zBaseFormatVersion.default^   s     3??))+,,r   c                H    t        | j                  j                               S r2   )	frozensetrF   rG   rH   s    r   supported_versionsz$BaseFormatVersion.supported_versionsc   s    //122r   )r-   Type[FormatVersion]r,   r0   r"   r   )r"   r(   )r,   objectr"   r   )r"   str)r-   rL   r"   r   )r-   rL   r"   zfrozenset[FormatVersion])r   
__module____qualname____annotations__r4   propertyr:   r>   classmethodr@   rC   r&   rK   __classcell__)r5   s   @r   r   r   C   sy    +     E E, - - 3 3r   __main__) )r   rN   r"   zCallable[[F], F])r,   FormatVersionInputr-   rL   r"   r   )__doc__
__future__r   typingr   r   r   r   r   collections.abcr	   enumr   r   rM   r
   r   r(   r)   rW   floatnumberTypesr$   r.   Enumr   r   doctesttestmodr#   r   r   <module>rb      s    # 7 7 $   CxV,-/BCeCsCx-$GHI El 8??$7?? "3c3h "3J zGOO r   