rL ix<PddlmZddlZGddeZGddZeZy))EnumNceZdZdZdZdZy) BackendFilterzx Filter used with :meth:`~matplotlib.backends.registry.BackendRegistry.list_builtin` .. versionadded:: 3.9 rN)__name__ __module__ __qualname____doc__ INTERACTIVENON_INTERACTIVEb/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/matplotlib/backends/registry.pyrrs KOrrc eZdZdZiddddddddddd d d d d d d d ddddddddddddddddddddddddZddddd dd ddd ZdZdZdZdZ d Z d!Z d"Z d#Z d$Zd%Zd,d'Zd(Zd)Zd*Zd+Zy&)-BackendRegistrya Registry of backends available within Matplotlib. This is the single source of truth for available backends. All use of ``BackendRegistry`` should be via the singleton instance ``backend_registry`` which can be imported from ``matplotlib.backends``. Each backend has a name, a module name containing the backend code, and an optional GUI framework that must be running if the backend is interactive. There are three sources of backends: built-in (source code is within the Matplotlib repository), explicit ``module://some.backend`` syntax (backend is obtained by loading the module), or via an entry point (self-registering backend in an external package). .. versionadded:: 3.9 gtk3agggtk3 gtk3cairogtk4agggtk4 gtk4cairomacosxnbaggnotebookqtaggqtqtcairoqt5aggqt5qt5cairotkaggtktkcairowebaggwxwxaggwxcairoheadless)aggcairopdfpgfpssvgtemplater)) rrr(rrrqt6r"r%c2d|_i|_ddi|_y)NFrr)_loaded_entry_points_backend_to_gui_framework_name_to_moduleselfs r__init__zBackendRegistry.__init__Ms%$)! *,&  rc|jdr|ddS|j}|jj||}|jdr|ddSd|S)N module:// zmatplotlib.backends.backend_) startswithlowerr4get)r6backends r_backend_module_namez$BackendRegistry._backend_module_name_sm   k *12; --/&&**7G<&11+>  ?3G9= ?rc$|jyN)r7r5s r_clearzBackendRegistry._clearms  rcn|js)|j}|j|d|_yy)NT)r2_read_entry_points _validate_and_store_entry_points)r6entriess r_ensure_entry_points_loadedz+BackendRegistry._ensure_entry_points_loadedqs4((--/G  1 1' :(,D %)rc\|j|}|j}|jxsdS)Nr()load_backend_module FigureCanvasrequired_interactive_framework)r6r>module canvas_classs r_get_gui_framework_by_loadingz-BackendRegistry._get_gui_framework_by_loadingxs0))'2** ::HjHrc ddlmjd}|Dcgc]}|j|jf}}fd}|Dcgc]}|d }}d|vr ||dddgdd |vr||d d d d gd |Scc}wcc}w) Nrzmatplotlib.backend)groupcddlm} j|}|||kr|D]}|j||fyy#j$rYywxYw)Nr)_parse_to_version_info) matplotlibrRversionappendPackageNotFoundError) rF module_namethreshold_versionnamestargetrRmodule_versionnameims r backward_compatible_entry_pointszLBackendRegistry._read_entry_points..backward_compatible_entry_pointssf 9 !#K!8).9backwards_compats ris_valid_backendz BackendRegistry.is_valid_backends,!!+.mmoG .69A #&&w8 t== =4999   k *6?D * *7 3 ((* d44 4rc^|jg|j|jS)a] Return list of all known backends. These include built-in backends and those obtained at runtime either from entry points or explicit ``module://some.backend`` syntax. Entry points will be loaded if they haven't been already. Returns ------- list of str Backend names. )rG list_builtinr3r5s rlist_allzBackendRegistry.list_alls/ ((*F""$Ft'E'EFFrNcJ|tjk(r2|jjDcgc] \}}|dk7r|c}}S|tjk(r2|jjDcgc] \}}|dk(r|c}}Sg|jScc}}wcc}}w)a Return list of backends that are built into Matplotlib. Parameters ---------- filter_ : `~.BackendFilter`, optional Filter to apply to returned backends. For example, to return only non-interactive backends use `.BackendFilter.NON_INTERACTIVE`. Returns ------- list of str Backend names. r()rr rnitemsr )r6filter_kvs rrwzBackendRegistry.list_builtin s m// /"&"H"H"N"N"P($!QJ( (  55 5"&"H"H"N"N"P($!QJ( (97788 ((s B6BcL|jDcgc] }|dk7s | c}Scc}w)z Return list of GUI frameworks used by Matplotlib backends. Returns ------- list of str GUI framework names. r()rp)r6r|s rlist_gui_frameworksz#BackendRegistry.list_gui_frameworks#s$ 99MaQ*_MMMs !!cN|j|}tj|S)a Load and return the module containing the specified backend. Parameters ---------- backend : str Name of backend to load. Returns ------- Module Module containing backend. )r? importlib import_module)r6r>rWs rrIz#BackendRegistry.load_backend_module.s%//8 &&{33rc0t|tr"|jds|j}n ddlm}|}|j j|xs|jj|}|#t|tr|jdrd}|7|js+|j|jj|}|dk(r |j|}||j|<|td|d||dk7r|fSdfS) a Return the backend and GUI framework for the specified backend name. If the GUI framework is not yet known then it will be determined by loading the backend module and checking the ``FigureCanvas.required_interactive_framework`` attribute. This function only loads entry points if they have not already been loaded and the backend is not built-in and not of ``module://some.backend`` format. Parameters ---------- backend : str or None Name of backend, or None to use the default backend. Returns ------- backend : str The backend name. framework : str or None The GUI framework, which will be None for a backend that is non-interactive. r9r) get_backendNrk'z"' is not a recognised backend namer() isinstancestrr;r<rSrrnr=r3r2rGrNrm)r6r>rguis rresolve_backendzBackendRegistry.resolve_backend?s. gs #%%k2!--/ /!mG5599'B;--11':  ;:gs38J8J;8WC ;t88  , , .0044W=C ) 44W=C69D * *7 3 ;7)+MNO Osj0::d::rc|jds|j}|j|}| ||dk7r|fSdfS |j|S#t$rt d|dwxYw)au Return the backend and GUI framework for the specified string that may be either a GUI framework or a backend name, tested in that order. This is for use with the IPython %matplotlib magic command which may be a GUI framework such as ``%matplotlib qt`` or a backend name such as ``%matplotlib qtagg``. This function only loads entry points if they have not already been loaded and the backend is not built-in and not of ``module://some.backend`` format. Parameters ---------- gui_or_backend : str or None Name of GUI framework or backend, or None to use the default backend. Returns ------- backend : str The backend name. framework : str or None The GUI framework, which will be None for a backend that is non-interactive. r9Nr(rz.' is not a recognised GUI loop or backend name)r;r<rrr Exceptionrm)r6gui_or_backendr>s rresolve_gui_or_backendz&BackendRegistry.resolve_gui_or_backendus0((5+113N00@  n .JNT TPTT T T''7 7 TN##QRT T Ts AA,rA)rrr r rnrpr7r?rBrGrNrDrErrrurxrwrrIrrr rrrrsk*)6)V) 6) V ) ( )  ) G) ) 4) %) E) ) 4) () d) !)" 4#)$1)%: ! $ ?-I#J=*E .`G"90 N4"4;l%Trr)enumrrrrbackend_registryr rrrs1DKTKT^ #$r