
    i%                         S SK Jr  S SKJrJr  S SKJr  \R                  S 5       r\R                  S 5       r	\R                  S 5       r
S rS rS	 rS
 rS rg)    )	is_darwin)loggerget_hook_config)isolatedc                  z    SSK n [        R                  U R                  S5      n[	        U[
        5      (       a  U$ g)z
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
r   Nbackend)
matplotlibdict__getitem__rcParams
isinstancestr)r	   vals     WC:\des-py\RoboSAPF\venv\Lib\site-packages\PyInstaller/hooks/hook-matplotlib.backends.py_get_configured_default_backendr      s6      

:..	
:C#s
    c                  6    SSK n U R                  R                  $ )z9
Returns the names of all available matplotlib backends.
r   N)r	   rcsetupall_backends)r	   s    r   _list_available_mpl_backendsr   !   s    
 ***r   c                     [        U 5        g)zm
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     {r   c                    SSK JnJn  1 U" S5      kU" S5      kn/ nU" U 5      R                  5        HR  nU HI  u  pg[	        U5      S;  d  [        US   [        5      (       d  M.  Xc;   d  M5  UR                  US   5        MK     MT     U$ )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_aliasrecursive_function_callszmatplotlib.usezmpl.use>         )PyInstaller.depend.bytecoder   r   valueslenr   r   append)cor   r   mpl_use_namesbackendscallsnameargss           r   (_recursive_scan_code_objects_for_mpl_user*   5   s     P	#	$	9	M
 H)"-446JD 4y&ja#.F.F$Q(   7 Or   c                 ^    U R                  S5      (       a  U SS $ SU R                  5        3$ )z|
Converts matplotlib backend name to its corresponding module name.

Equivalent to matplotlib.cbook._backend_module_name().
z	module://	   Nzmatplotlib.backends.backend_)
startswithlower)r(   s    r   _backend_module_namer/   P   s1     {##ABx)$**,88r   c                    U R                   R                  nUR                  S5      n/ nUR                  5        H4  u  pE[	        U5      nU(       d  M  [
        R                  " SXF5        X6-  nM6     [        [        U5      5      nU(       a  Sn[
        R                  " SX75        U$ [        5       nU(       a  [
        R                  " SU5        U/$ / SQn	[        (       a  S/U	-   n	[
        R                  " SU	5        U	 H  n
 [        U
5      n[        U5        U
/s  $    [
        R                  " S	5        S
/$ ! [         a     MG  f = f)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-hooksa  The 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)QtAggQt5AggGtk4AggGtk3AggTkAggWxAggMacOSXzTTrying 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)analysisgraphget_code_usingitemsr*   r   infosortedsetr   r   r/   r   	Exception)hook_apimodulegraphmpl_code_objsused_backendsr(   r$   co_backendsHOOK_CONFIG_DOCSdefault_backend
candidates	candidater   s               r   _autodetect_used_backendsrJ   [   sD    ##))K..|<MM!'')>rB;KK_ae (M * 3}-.MaABO	

  67OEW   MJyZ*,

KKfhrs		.y9K)+6 {   KKab7N  		s   D;;
E	E	c                    [        5       n[        R                  " SU5        / nSS1n[        (       d  USS1-  nU H`  nXC;   a  [        R                  " SU5        M!   [	        U5      n[        U5        [        R                  " SU5        UR                  U5        Mb     U$ ! [         a    [        R                  " SU5         M  f = f)	zf
Returns a list of all importable matplotlib backends. Implements the 'all' backend selection method.
z%All available matplotlib backends: %rQt4AggQt4CairoCocoaAggr7   z!  Matplotlib backend %r: excludedz4  Matplotlib backend %r: ignored due to import errorz  Matplotlib backend %r: added)r   r   r=   r   r/   r   r@   r#   )rA   backend_namesimportable_backendsexclude_backendsbackend_namer   s         r    _collect_all_importable_backendsrS      s    
 12M
KK7G  !*-
 9Z22 &+KK;\J	.|<K)+6 	4lC""<0 &    	KKNP\]	s   B""!CCc                    [        U SS5      nUc  SnUS:X  a"  [        R                  " S5        [        U 5      nOuUS:X  a"  [        R                  " S5        [	        U 5      nOM[        R                  " S5        [        U[        5      (       a  U/nO[        U[        5      (       d   S5       eUn[        [        U5      5      n[        R                  " S	U5        U Vs/ s H  n[        U5      PM     nnU R                  " U6   g s  snf )
Nr	   r&   autozIMatplotlib backend selection method: automatic discovery of used backendsallzJMatplotlib backend selection method: collection of all importable backendsz:Matplotlib backend selection method: user-provided name(s)z@User-provided backend name(s) must be either a string or a list!z Selected matplotlib backends: %r)r   r   r=   rJ   rS   r   r   listr>   r?   r/   add_imports)rA   backends_methodrO   r   module_namess        r   hookr[      s    %hjIO  & _`1(;	E	!`a8BPQos++,-Mot44x6xx4+M 3}-.M
KK2MB BOOg(1LO,' Ps   DN)PyInstaller.compatr   PyInstaller.utils.hooksr   r   PyInstallerr   decorater   r   r   r*   r/   rJ   rS   r[    r   r   <module>ra      sz    ) ;   
  
+ + 
 69@F%P(r   