)Ej_@dZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z m Z mZmZedZedZde eefd e eeffd Zd e eeefd e e eefge eefffd ZGd de Zd efdZdS)z Utilities to manage deprecation errors & warnings. The contents of this module are internal to fpdf2, and not part of the public API. They may change at any time without prior warning or any deprecation period, in non-backward-compatible ways. N)wraps) ModuleType)AnyCallableIterable ParamSpecTypeVarPRfnreturnc|tdtjdtjdtffd }|S)z.wrappers~JJud++   !QRRR&F6N MI"*,,     r4"6"""rr rrr )r rs` rsupport_deprecated_txt_argr!sS 2YY #qv # #a # # # # #Y # Nr parametersct|tdtttfdtttfffd }|S)zEDecorator removing deprecated keyword arguments from a function call.r r ctdtjdtjdtffd }|S)Nrrr cD]L\}}||ur/tjd|d|dtt M|i|S)N"z!" parameter is deprecated since vz( and will be removed in a future releaser)rrrrr)rrnameversion _sentineldeprecated_infor s rrz8deprecated_parameter..decorator..wrapper2s!0   g::dI..i??MtDtt7ttt*#2#4#4 2t&v&& &rr )r rr)r*s` r decoratorz'deprecated_parameter..decorator1s\ r '16 'QX '! ' ' ' ' ' ' '  'r)tupleobjectrr r )r"r+r)r*s @@rdeprecated_parameterr.)se J''OI hq!tn !Q$        rcHeZdZddZdedeffd Zdededdffd ZxZS) WarnOnDeprecatedModuleAttributesr Nc td)NzrYou tried to instantied the fpdf module. You probably want to import the FPDF class instead: from fpdf import FPDF) TypeError)selfs r__call__z)WarnOnDeprecatedModuleAttributes.__call__Cs %   rr'c|dvr*tjdttdSt |SN)FPDF_CACHE_DIRFPDF_CACHE_MODEzefpdf.FPDF_CACHE_DIR & fpdf.FPDF_CACHE_MODE have been deprecated in favour of FPDF(font_cache_dir=...)r)rrrrsuper__getattribute__)r3r' __class__s r __getattr__z,WarnOnDeprecatedModuleAttributes.__getattr__JsZ 8 8 8 M0#*,,    4ww''---rvaluec|dvr*tjdttdSt ||dSr6)rrrrr9 __setattr__)r3r'r=r;s rr?z,WarnOnDeprecatedModuleAttributes.__setattr__Xsb 8 8 8 M0#*,,     F D%(((((r)r N) __name__ __module__ __qualname__r4strrr<r? __classcell__)r;s@rr0r0Bs     . . . . . . . . ) )C )D ) ) ) ) ) ) ) ) ) )rr0crddl}tj|j}tjt j}t j}d}|Nt j|}| |s| |r |j }|dz }nn|N|S)z>Get the first place in the call stack that is not inside fpdf2rN) fpdfospathdirname__file__ contextlibinspect currentframegetfile startswithf_back)rGpkg_dircontextlib_dirframenfnames rrrgsKKKgoodm,,GW__Z%899N  " "E A  &&   G $ $ (8(8(H(H LE FAA    Hr)__doc__rLrMos.pathrHr functoolsrtypesrtypingrrrrr r r r!r,rCr.r0intrrrr^sp>>>>>>>>>>>>>> IcNN GCLL8AqD>hq!tn(sCx) x1~A./2")")")")")z")")")J       r