
    G@d	                     n    d Z ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ  G d d	e	          ZdS )
zMain interpreter container.    N)Signal)on_conf_change)PluginMainContainer)InterpreterStatus)get_python_executablec                       e Zd Z e            Z	  e            Z	  ee          Z	 d Zd Z	 e
g d          d             Z e
dg          d             Zd Zd	 Zd
 ZdS )MainInterpreterContainerc                     t          | |                                           | _        | j        j                            | j                   d S )N)parentinterpreter)r   get_main_interpreterinterpreter_statussig_open_preferences_requestedconnectselfs    Hlib/python3.11/site-packages/spyder/plugins/maininterpreter/container.pysetupzMainInterpreterContainer.setup)   s[    "31133#
 #
 #

 	>FF/	1 	1 	1 	1 	1    c                     d S N r   s    r   update_actionsz'MainInterpreterContainer.update_actions3   s    r   )defaultcustom_interpretercustom)optionc                 (   |dk    r|s|dk    r|st                      }nAt          j        |                     d                    }| j                            |           ||                     d          k    r|                     d|           d S d S )Nr   r   r   
executable)r   ospnormpathget_conf(sig_add_to_custom_interpreters_requestedemitset_conf)r   r   valuer   s       r   on_interpreter_changedz/MainInterpreterContainer.on_interpreter_changed6   s    y  U 8##E#.00JJdmm4H&I&IJJJ9>>zJJJ |4444MM,
33333 54r   r   c                 `    |                                   | j                                         d S r   )_update_statussig_interpreter_changedr$   )r   r&   s     r   on_executable_changedz.MainInterpreterContainer.on_executable_changedC   s1     	$))+++++r   c                 8    | j                                          d S r   )r   closer   s    r   on_closez!MainInterpreterContainer.on_closeI   s    %%'''''r   c                 F    |                      dt                                S )Nr   )r"   r   r   s    r   r   z-MainInterpreterContainer.get_main_interpreterM   s    }}\+@+B+BCCCr   c                 ^    | j                             |                                            dS )zUpdate status widget.N)r   update_interpreterr   r   s    r   r)   z'MainInterpreterContainer._update_statusQ   s6    22%%''	) 	) 	) 	) 	)r   N)__name__
__module____qualname__r   r   r*   strr#   r   r   r   r'   r+   r.   r   r)   r   r   r   r	   r	      s        %+VXX" %fhh 06vc{{,
1 1 1   ^FFFGGG
4 
4 HG
4 ^L>***, , +*,
( ( (D D D) ) ) ) )r   r	   )__doc__os.pathpathr    qtpy.QtCorer   spyder.api.config.decoratorsr   !spyder.api.widgets.main_containerr   -spyder.plugins.maininterpreter.widgets.statusr   spyder.utils.miscr   r	   r   r   r   <module>r>      s    " !             8 7 7 7 7 7 A A A A A A K K K K K K 3 3 3 3 3 3=) =) =) =) =)2 =) =) =) =) =)r   