L ix 8dZddlmZddlmZmZmZmZmZddl m Z ddl Z ddl Z ddl Z ede defZed d ZeeeeeefefZeefZddd Z dd ZGd d eeefe j0Zedk(rddlZej8yy)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)OptionalTypeTypeVarUnioncast)CallableNF.)bound FormatVersionBaseFormatVersioncdfd }|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 cbtjfd}tt|S)Ncjtjjdtd|i|S)Nz function is a deprecated. )category stacklevel)warningswarn__name__DeprecationWarning)argskwargsfuncmsgs \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/ufoLib/utils.pywrapperz9deprecated..deprecated_decorator..wrapper%s: MM==/!.deprecated_decorator$s-   )  )Awr)rr returnr )rr!s` r deprecatedr$s   rc||jSt||r|St|tr ||dfSt|trt |dk(r||St d|)NrrzUnsupported format version: )default isinstanceinttuplelen ValueError)valueclss rnormalizeFormatVersionr.3sm }{{}% %E1:%CJ!O5z 3E9= >>rceZdZUded<d fd Zed dZed dZed dZ d dZ eddZ edd Z xZ S)r tuple[int, int]r,c$t|||SN)super__new__)r-r, __class__s rr4zBaseFormatVersion.__new__FswsE**rc |jdS)Nrr,selfs rmajorzBaseFormatVersion.majorIzz!}rc |jdS)Nr7r8s rminorzBaseFormatVersion.minorMr;rct|tr ||dfS||jSt|d|j)Nrz is not a valid )r'r(r&r+r)r-r,s r _missing_zBaseFormatVersion._missing_QsH eS !qz? " =;;= E9$4S\\NCDDrc8|jd|jS)N.)r:r>r8s r__str__zBaseFormatVersion.__str__[s**Qtzzl++rcHt|jjSr2)max __members__valuesr-s rr&zBaseFormatVersion.default^s3??))+,,rcHt|jjSr2) frozensetrFrGrHs rsupported_versionsz$BaseFormatVersion.supported_versionscs//122r)r-Type[FormatVersion]r,r0r"r )r"r()r,objectr"r )r"str)r-rLr"r )r-rLr"zfrozenset[FormatVersion])r __module__ __qualname____annotations__r4propertyr:r> classmethodr@rCr&rK __classcell__)r5s@rr r Csy +EE,--33r__main__))rrNr"zCallable[[F], F])r,FormatVersionInputr-rLr"r )__doc__ __future__rtypingrrrrrcollections.abcr enumrrrMr r r(r)rWfloat numberTypesr$r.Enumr rdoctesttestmodr#rrrbs#77$  CxV ,-/BC eCsCx-$GHIEl  8 ?  ?$7 ? ? "3c3h"3J zGOOr