a
    a	                     @   s`   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	 d	e	ZdS )
zMain interpreter container.    N)Signal)on_conf_change)PluginMainContainer)InterpreterStatus)get_python_executablec                   @   sV   e Zd Ze Ze ZeeZdd Zdd Z	e
g dddd Zd	d
 Zdd ZdS )MainInterpreterContainerc                 C   s&   t | |  d| _| jj| j d S )N)parentZinterpreter)r   get_main_interpreterinterpreter_statussig_open_preferences_requestedZconnectself r   Glib/python3.9/site-packages/spyder/plugins/maininterpreter/container.pysetup)   s    zMainInterpreterContainer.setupc                 C   s   d S )Nr   r   r   r   r   update_actions3   s    z'MainInterpreterContainer.update_actionsdefaultcustom_interpretercustom)optionc                 C   sP   |dv rL|rL|    | j  t| d}|dv rLt|rL| j| d S )Nr   r   )r   r   )_update_statussig_interpreter_changedemitospnormpathget_confisfile(sig_add_to_custom_interpreters_requested)r   r   value
executabler   r   r   section_conf_update6   s    
z,MainInterpreterContainer.section_conf_updatec                 C   s8   |  drt S t|  d}t|r.|S t S d S )Nr   r   )r   r   r   r   r   )r   r    r   r   r   r	   C   s    

z-MainInterpreterContainer.get_main_interpreterc                 C   s   | j |   dS )zUpdate status widget.N)r
   Zupdate_interpreterr	   r   r   r   r   r   P   s    z'MainInterpreterContainer._update_statusN)__name__
__module____qualname__r   r   r   strr   r   r   r   r!   r	   r   r   r   r   r   r      s   

r   )__doc__os.pathpathr   Zqtpy.QtCorer   Zspyder.api.config.decoratorsr   Z!spyder.api.widgets.main_containerr   Z-spyder.plugins.maininterpreter.widgets.statusr   Zspyder.utils.miscr   r   r   r   r   r   <module>   s   