
    G@d
                         d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl	m
Z
 ddlmZ  ej        e          Zd Zd ZdS )	z
Plugin dependency solver.
    N)SpyderAPIError)Plugins)get_class_values)STDERRc                  d   i } t          t          j        d                    }t          t                    }|D ]J}|j        }||vr|j        d         }t          j        |j	                  }t          ||d          }|| |<   Kd t          |                                           D             } | S )zA
    Find internal plugins based on setuptools entry points.
    spyder.pluginsr   Nc                     i | ]\  }}||	S  r
   ).0keyvalues      7lib/python3.11/site-packages/spyder/app/find_plugins.py
<dictcomp>z)find_internal_plugins.<locals>.<dictcomp>/   s+       !sEU      )listpkg_resourcesiter_entry_pointsr   r   nameattrs	importlibimport_modulemodule_namegetattrsorteditems)internal_pluginsentry_pointsinternal_namesentry_pointr   
class_namemodplugin_classs           r   find_internal_pluginsr#      s     78HIIJJL%g..N# . .~%% &q)
%k&=>>sJ55!-
 %+,<,B,B,D,D%E%E   r   c            	         t          t                    } t          t          j        d                    }i }|D ]}|j        }|| vr 	 |j        d         }t          j        |j	                  }t          ||d          }|j	        |_        |j        j        |_        |j        j        |_        |||<   ||j        k    r(t%          d                    ||j                            # t(          t*          f$ rM}t-          |dt/          |          t0                     t3          j        t0                     Y d}~d}~ww xY w|S )zK
    Find available external plugins based on setuptools entry points.
    r   r   Nz:Entry point name '{0}' and plugin.NAME '{1}' do not match!z: )file)r   r   r   r   r   r   r   r   r   r   r   _spyder_module_namedistproject_name_spyder_package_nameversion_spyder_versionNAMEr   formatModuleNotFoundErrorImportErrorprintstrr   	traceback	print_exc)	r   pluginsexternal_pluginsr   r   r    r!   r"   errors	            r   find_external_pluginsr7   6   su    &g..N=23CDDEEG 1 1~%%1(.q1
-k.EFF&sJ== 4?3J0$1 1/:/?/G,)5 &<,,,(((.t\5F(G(G   -
 (5 1 1 1$$$E


3&AAAA#0000000001% &, s   
BC((E9AEE)__doc__r   loggingr2   r   spyder.api.exceptionsr   spyder.api.pluginsr   spyder.api.utilsr   spyder.config.baser   	getLogger__name__loggerr#   r7   r
   r   r   <module>rA      s                  0 0 0 0 0 0 & & & & & & - - - - - - % % % % % % 
	8	$	$  :         r   