)Ej TdZddlmZddlmZmZmZmZmZddl m Z ddl Z ddl Z ddl Z ede defZed d ZeeeeeefefZeefZdddZddZGdd eeefe jZedkrddlZejdSdS)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 FormatVersionBaseFormatVersionmsgstrreturnCallable[[F], F]cdfd }|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 rcptjfd}tt|S)Nc`tjjdtd|i|S)Nz function is a deprecated. )category stacklevel)warningswarn__name__DeprecationWarning)argskwargsrrs HC:\PYTHON\MyICR_Suite\python\Lib\site-packages\fontTools/ufoLib/utils.pywrapperz9deprecated..deprecated_decorator..wrapper%sL M=BBSBB+     4((( () functoolswrapsrr )rr!rs` r deprecated_decoratorz(deprecated..deprecated_decorator$sI    ) ) ) ) )   )Awr")rr rr )rr%s` r deprecatedr's)        r"valueFormatVersionInputclsType[FormatVersion]c ||St||r|St|tr ||dfSt|trt |dkr ||St d|)NrrzUnsupported format version: )default isinstanceinttuplelen ValueError)r(r*s r normalizeFormatVersionr33s }{{}}% %sE1:%CJJ!OOs5zz =E== > >>r"ceZdZUded<dfd ZeddZedd Zedd Z dd Z eddZ eddZ xZ S)r tuple[int, int]r(r*r+rcHt||SN)super__new__)r*r( __class__s r r9zBaseFormatVersion.__new__FswwsE***r"r/c|jdS)Nrr(selfs r majorzBaseFormatVersion.majorIz!}r"c|jdS)Nr<r=s r minorzBaseFormatVersion.minorMr@r"objectct|tr ||dfS||St|d|j)Nrz is not a valid )r.r/r-r2r)r*r(s r _missing_zBaseFormatVersion._missing_QsY eS ! ! #3qz?? " =;;== ECCS\CCDDDr"rc$|jd|jS)N.)r?rCr=s r __str__zBaseFormatVersion.__str__[s*++tz+++r"r cNt|jSr7)max __members__valuesr*s r r-zBaseFormatVersion.default^s 3?))++,,,r"frozenset[FormatVersion]cNt|jSr7) frozensetrLrMrNs r supported_versionsz$BaseFormatVersion.supported_versionscs//11222r")r*r+r(r5rr )rr/)r(rDrr )rr)r*r+rr )r*r+rrO)r __module__ __qualname____annotations__r9propertyr?rC classmethodrFrIr-rR __classcell__)r:s@r r r Cs++++++XXEEE[E,,,,---[-333[33333r"__main__)r)rrrr)r(r)r*r+rr )__doc__ __future__rtypingrrrrrcollections.abcr enumr#rrDr r r/r0r)float numberTypesr'r3Enumr rdoctesttestmodr&r"r rdso#"""""77777777777777$$$$$$  GCxV ,---/BCCC eCsCx-$GHIEl      8 ? ? ? ? "3"3"3"3"3c3h"3"3"3J zNNNGOr"