L iddlZGddeZGddeZGddeZGdd eZGd d eZGd d eZGddeZGddeZ GddeZ GddeZ GddeZ GddeZ Gdde ZGddeZGddeZGd d!eZGd"d#eZGd$d%eZy)&NceZdZdZy) VarLibErrorz%Base exception for the varLib module.N__name__ __module__ __qualname____doc__]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/fontTools/varLib/errors.pyrrs/r rceZdZdZy)VarLibValidationErrorz>Raised when input data is invalid from varLib's point of view.Nrr r r rrsHr rcTeZdZdZd dZedZdZedZedZ dZ y) VarLibMergeErrorz=Raised when input data cannot be merged into a variable font.Nc h||_|si}d|vr|d|_|d=||_yg|_||_y)Nstack)mergerrcause)selfrkwargss r __init__zVarLibMergeError.__init__sD F f DJw DJ r c|jSN)r )rs r reasonzVarLibMergeError.reasons ||r cV|j|jj|}d|vr&|djr|djSt|jdr@t|jj dr |jj j Sd|S)Nnamefilezmaster number )rttfsgetBestFullNamehasattrreaderrr)rixttfs r _master_namezVarLibMergeError._master_names ;; "++""2&C}V!6{2244V,&1Qzz+++t$$r c.d|jvrd|jvrt|jdDcgc]}||jdk(c}jd}|j|}d|jvr|d|jdd}||fSycc}w)NexpectedgotFlocation ())NNrindexr$)rxr, master_names r offenderzVarLibMergeError.offender's  #(;:>**U:KLQQ$**Z00LRRE++E2KTZZ'!, R :0F/GqI +% %MsBcd|jvrUd|jvrG|j\}}|jd|}d|jdd|jdd|dSy) Nr&r'zExpected to see r==z, instead saw  )rr/r)roffender_indexr/r's r detailszVarLibMergeError.details3sn  #(;'+}} $NH**U#N3C%djjm_Btzz*7M6PP^_b^eegh hr c|j\}}d}|rd|d}djt|j}t j d|j d|d}d|z|z|jzS) Nr3z! The problem is likely to be in z: z"Couldn't merge the fonts, because z:. This happened while performing the following operation: N)widthz )r/joinreversedrtextwrapfillrr5)rr4r/r(contextbasics r __str__zVarLibMergeError.__str__;s#'==  GGNi Q  ~(4<<77r r) rrrr rpropertyrr$r/r5r?r r r rr sPG %   8r rc,eZdZdZefdZxZS)ShouldBeConstantz9some values were different, but should have been the samect }jddk7s j|Sjddk(sJj\}}jj |}t fdjj D}|jdjjjDcgc]}|j}}|jdjjjDcgc]}|j}}|ddj|ddj|dzScc}wcc}w) Nrz .FeatureCountc3K|]W}jd|vrD|jdjjjjdk(r|Yyw)r&N)rtable FeatureList FeatureCountr).0r#rs r z+ShouldBeConstant.details..Vs\ zz"~$DJJrN#))55BBzz*%&  sAA rEz2 Incompatible features between masters. Expected: z, z. Got: z. ) superr5rrr/rnextrFrG FeatureRecord FeatureTagr9) r basic_messager4_bad_ttfgood_ttfr- good_features bad_features __class__s ` r r5zShouldBeConstant.detailsLsP ::a=O +t{{/B zz!}/// MM++"">2 {{''  djjn-33??MM  LL  TZZ^,22>>LL  LL   =123IIl+,C 1    s E  E)rrrr r@r5 __classcell__rUs@r rBrBIsC   r rBc0eZdZdZedZedZy) FoundANonezAone of the values in a list was empty when it shouldn't have beenc|jdDcgc]}|duc}jd}||j|fScc}wNr'Tr+rr-r,s r r/zFoundANone.offenderpsE$(JJu$56qd6<rs0)0IKI:8{:8z! '! H /! / / /&&&5$5/!/;-;A-A (  M+M +  !1 ! !#6 ! !"5 !3+3r