;i%ddlmZddlmZmZddlmZejdZejdZ ejdZ dZ dZ d Z d Zd Zd S) ) is_darwin)loggerget_hook_config)isolatedc|ddl}t|jd}t |t r|SdS)a Return the configured default matplotlib backend name, if available as matplotlib.rcParams['backend'] (or overridden by MPLBACKEND environment variable. If the value of matplotlib.rcParams['backend'] corresponds to the auto-sentinel object, returns None rNbackend) matplotlibdict __getitem__rcParams isinstancestr)r vals ^C:\PYTHON\MyICR_Workspace\venv\Lib\site-packages\PyInstaller/hooks/hook-matplotlib.backends.py_get_configured_default_backendrsF   :. : :C#s 4c"ddl}|jjS)zA Returns the names of all available matplotlib backends. rN)r rcsetup all_backends)r s r_list_available_mpl_backendsr!s    **rc$t|dS)zy Attempts to import the given module name (matplotlib backend module). Exceptions are propagated to caller. N) __import__) module_names r_check_mpl_backend_importabler*s{rc2ddlm}m}h|d|d}g}||D]V}|D]Q\}}t |dvst |dt s2||vr||dRW|S)z Recursively scan the bytecode for occurrences of matplotlib.use() or mpl.use() calls with const arguments, and collect those arguments into list of used matplotlib backend names. r) any_aliasrecursive_function_callszmatplotlib.usezmpl.use>)PyInstaller.depend.bytecoderrvalueslenr rappend)corr mpl_use_namesbackendscallsnameargss r(_recursive_scan_code_objects_for_mpl_user*5s POOOOOOO # $ $ 9  M H))"--4466)) ) )JD$4yy&&ja#.F.F&}$$Q((( ) Orcn|dr |ddSd|S)z Converts matplotlib backend name to its corresponding module name. Equivalent to matplotlib.cbook._backend_module_name(). z module:// Nzmatplotlib.backends.backend_) startswithlower)r(s r_backend_module_namer/Ps;  {##ABBx 8$**,, 8 88rc|jj}|d}g}|D]1\}}t |}|rt jd||||z }2tt|}|rd}t jd|||St}|rt jd||gSgd} trdg| z} t jd| | D]6} t| } t| n#t$rY.wxYw| gcSt jd d gS) z Returns a list of automatically-discovered matplotlib backends in use, or the name of the default matplotlib backend. Implements the 'auto' backend selection method. r zMDiscovered Matplotlib backend(s) via `matplotlib.use()` call in module %r: %rzDhttps://pyinstaller.org/en/stable/hooks-config.html#matplotlib-hooksaThe following Matplotlib backends were discovered by scanning for `matplotlib.use()` calls: %r. If your backend of choice is not in this list, either add a `matplotlib.use()` call to your code, or configure the backend collection via hook options (see: %s).z/Found configured default matplotlib backend: %s)QtAggQt5AggGtk4AggGtk3AggTkAggWxAggMacOSXzTTrying determine the default backend as first importable candidate from the list: %rzONone of the backend candidates could be imported; falling back to headless Agg!Agg)analysisgraphget_code_usingitemsr*rinfosortedsetrrr/r Exception) hook_api modulegraph mpl_code_objs used_backendsr(r$ co_backendsHOOK_CONFIG_DOCSdefault_backend candidates candidaters r_autodetect_used_backendsrJ[s #)K..|<rBB  ) K_aegr    [ (M3}--..Ma  ABOQa   677O! EWWW  MLLJ-Z*,  Kfhrsss  .y99K )+ 6 6 6 6    H { Kabbb 7Ns5D D! D!ct}tjd|g}ddh}ts|ddhz}|D]}||vrtjd| t |}t |n%#t $rtjd|Y]wxYwtjd||||S) zn Returns a list of all importable matplotlib backends. Implements the 'all' backend selection method. z%All available matplotlib backends: %rQt4AggQt4CairoCocoaAggr7z! Matplotlib backend %r: excludedz4 Matplotlib backend %r: ignored due to import errorz Matplotlib backend %r: added)rrr=rr/rr@r#)rA backend_namesimportable_backendsexclude_backends backend_namers r _collect_all_importable_backendsrSs  122M K7GGG!*- 3Z22&11 + + + K;\ J J J  .|<zhook..s!OOOg(11OOOr) rrr=rJrSr rlistr>r? add_imports)rAbackends_methodrO module_namess rhookr_s%h jIIO &   _```1(;; E ! ! `aaa8BB  PQQQ os + + ,,-MMot44 x x6x x x4+M3}--..M K2MBBBPOOOOLH,''''rN)PyInstaller.compatrPyInstaller.utils.hooksrr PyInstallerrdecoraterrrr*r/rJrSr_rXrrrds)(((((;;;;;;;;      +++ 6999@@@F%%%P(((((r