
    G@dE                        d Z ddlmZ ddlZddlZddlZddlmZ ddl	Z	ddl
mZmZ ddlZddlmZmZmZ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 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'm(Z( ddl)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0 ddl1m2Z2  ej3        e4          Z5 G d dee"ee          Z6 G d de6          Z7dS )zd
New API for plugins.

All plugins in Spyder 5+ must inherit from the classes present in this file.
    )OrderedDictN)ListUnion)QObjectQtSignalSlot)QCursor)QApplication)SpyderConfigurationObserver)SpyderAPIError)SpyderPluginObserver)_)PluginMainWidget)SpyderActionMixin)SpyderWidgetMixin)get_options)get_color_schemeget_font)	NoDefault)ima)IMAGE_PATH_MANAGER   )Plugins)SpyderPluginWidgetc                   n    e Zd ZdZdZg Zg ZdZdZdZ	dZ
dZdZdZdZg ZdZdZdZdZdZ e            Z	  e            Z	  e            Z	  e            Z	  eee          Z	  ee          Z	  ee          Z 	  ed          Z!	  ed          Z"	  ede#f          Z$	  ee#          Z%	 dZ&d3 fd	Z'd4d
Z(d Z)d Z*d Z+d Z,d Z-d5dZ.d Z/d Z0d Z1e2dfdZ3 e4ee#           e4ee#e          	 	 d6d                        Z5d3dZ6d5dZ7d3dZ8d3dZ9 e4e           e4ee          d7d                        Z:d Z;d8dZ<d Z=d Z>e?d              Z@eAd4d!            ZBd" ZCe?d#             ZDd$ ZEd% ZFd& ZGe?d'             ZHd( ZId) ZJd* ZKd4d+ZLd,efd-ZMd. ZNd/ ZOd0 ZPd1eQeReeSf                  fd2ZT xZUS )9SpyderPluginV2z
    A Spyder plugin to extend functionality without a dockable widget.

    If you want to create a plugin that adds a new pane, please use
    SpyderDockablePlugin.
    NTr   QResizeEvent
QMoveEvent c                    t                                          |           t          j        |            t          j        |            || _        d | _        || _        t          j        	                    t          j        | j                            | _        d | _        t                      | _        i | _        d | _        d | _        || _        | j        | _        | j        S|                     | j        | |          x| _        }t1          |t2                    r(|                                 |                                 |j                            | j                   |j                            | j                   |j                            | j                   |j                             | j                    |j!                            | j!                   |j"                            | j"                   | #                                 tI          |d          r|%                                 | j&        rBtO          j(        | )                                | j&                  }tU          j+        |           d S d S )N)namepluginparent_setup),super__init__r   r   _main_widget_confospathdirnameinspectgetfile	__class___plugin_path
_containerr   _added_toolbars_actionsis_compatibleis_registeredmainNAMEPLUGIN_NAMECONTAINER_CLASS
isinstancer   setupupdate_actionssig_free_memory_requestedconnectsig_quit_requestedsig_restart_requestedsig_redirect_stdio_requestedsig_exception_occurredsig_unmaximize_plugin_requestedafter_container_creationhasattrr%   IMG_PATHospjoinget_pathr   add_image_path)selfr$   configuration	containerplugin_pathr0   s        :lib/python3.11/site-packages/spyder/api/plugins/new_api.pyr'   zSpyderPluginV2.__init__*  s[      
 	%d+++#,T222
"
GOOGODN,K,KLL*}}!!	  9+*.*>*>Y +? + + DOi )%677 +!!!((*** /77.0 0 0(001HIII+33D4NOOO2::13 3 3,44+- - -5==46 6 6 ))+++y(++ #  """ = 	;(4==??DMBBK-k:::::	; 	;    Fc                     | j         t          d          | j        |s| j                            |            d| _        |                                  dS )zl
        Setup and register plugin in Spyder's main window and connect it to
        other plugins.
        Nz%A Spyder Plugin must define a `NAME`!T)r8   r   r*   register_pluginr6   update_font)rL   	omit_confs     rP   	_registerzSpyderPluginV2._registere  sb     9 !HIII :!)!J&&t,,, "rQ   c                 r    | j         | j                             |            d| _        d| _        d| _        dS )zs
        Disconnect signals and clean up the plugin to be able to stop it while
        Spyder is running.
        NF)r*   unregister_pluginr2   r5   r6   rL   s    rP   _unregisterzSpyderPluginV2._unregisterz  s?     :!J((...!"rQ   c                     | j         S )z2
        Return the plugin's system path.
        )r1   rY   s    rP   rJ   zSpyderPluginV2.get_path  s       rQ   c                     | j         S )z3
        Return the plugin main container.
        )r2   rY   s    rP   get_containerzSpyderPluginV2.get_container  s     rQ   c                     | j         S )z9
        Return the Spyder configuration object.
        )r*   rY   s    rP   get_configurationz SpyderPluginV2.get_configuration       zrQ   c                     | j         S )z1
        Return the Spyder main window..
        )r(   rY   s    rP   get_mainzSpyderPluginV2.get_main  r`   rQ   c                 B   t          | j        pg           }t          | j        pg           }||z  }||v st          j        |v r;	 | j                            ||          S # t          $ r}||v rY d}~dS |d}~ww xY wt          d                    |                    )a8  
        Get a plugin instance by providing its name.

        Parameters
        ----------
        plugin_name: str
            Name of the plugin from which its instance will be returned.
        error: bool
            Whether to raise errors when trying to return the plugin's
            instance.
        )errorNz:Plugin "{}" not part of REQUIRES or OPTIONAL requirements!)	setREQUIRESOPTIONALr   Allr(   
get_pluginr   format)rL   plugin_namerd   requiresoptionalfull_setes          rP   ri   zSpyderPluginV2.get_plugin  s     t}*++t}*++h&(""gkX&=&=z,,[,FFF!   (**44444G	 !))/)<)<  s   A! !
A<+A75A77A<c                 6    | j                             |          S )z2Determine if a given plugin is going to be loaded.)r(   is_plugin_enabledrL   rk   s     rP   rq   z SpyderPluginV2.is_plugin_enabled  s    z++K888rQ   c                 6    | j                             |          S )z)Determine if a given plugin is available.)r(   is_plugin_availablerr   s     rP   rt   z"SpyderPluginV2.is_plugin_available  s    z--k:::rQ   c                     t          | j        pg           }g }| j                                        D ]H\  }}||v st          j        |v r1t          |t          t          f          r|	                    |           I|S )z
        Return a list of the required plugin instances.

        Only required plugins that extend SpyderDockablePlugin are returned.
        )
re   rf   r(   get_dockable_pluginsr   rh   r;   SpyderDockablePluginr   append)rL   rl   dockable_plugins_requiredr"   plugin_instances        rP   rv   z#SpyderPluginV2.get_dockable_plugins  s     t}*++$&!%)Z%D%D%F%F 	B 	B!D/  GK8$;$;#)+=>B@ B@$; *00AAA((rQ   c                     | j         8|| j        n|}|t          d          | j                             |||          S dS )a  
        Get an option from Spyder configuration system.

        Parameters
        ----------
        option: str
            Name of the option to get its value from.
        default: bool, int, str, tuple, list, dict, NoDefault
            Value to get from the configuration system, passed as a
            Python object.
        section: str
            Section in the configuration system, e.g. `shortcuts`.

        Returns
        -------
        bool, int, str, tuple, list, dict
            Value associated with `option`.
        N=A spyder plugin must define a `CONF_SECTION` class attribute!)r*   CONF_SECTIONr   get)rL   optiondefaultsections       rP   get_confzSpyderPluginV2.get_conf  s[    & :!+2?d''G$!   :>>'67;;; "!rQ   c                     | j         S|| j        n|}|t          d          | j                             ||||           |                     |hd           dS dS )aj  
        Set an option in Spyder configuration system.

        Parameters
        ----------
        option: str
            Name of the option (e.g. 'case_sensitive')
        value: bool, int, str, tuple, list, dict
            Value to save in the configuration system, passed as a
            Python object.
        section: str
            Section in the configuration system, e.g. `shortcuts`.
        recursive_notification: bool
            If True, all objects that observe all changes on the
            configuration section and objects that observe partial tuple paths
            are notified. For example if the option `opt` of section `sec`
            changes, then the observers for section `sec` are notified.
            Likewise, if the option `(a, b, c)` changes, then observers for
            `(a, b, c)`, `(a, b)` and a are notified as well.
        Nr|   )recursive_notificationF)r*   r}   r   re   
apply_conf)rL   r   valuer   r   s        rP   set_confzSpyderPluginV2.set_conf  s    0 :!+2?d''G$!  
 JNN7FE2H  J J JOOVHe,,,,, "!rQ   c                     | j         P|| j        n|}|t          d          | j                             ||           |                     |hd           dS dS )a&  
        Delete an option in the Spyder configuration system.

        Parameters
        ----------
        option: Union[str, Tuple[str, ...]]
            Name of the option, either a string or a tuple of strings.
        section: str
            Section in the configuration system.
        Nr|   F)r*   r}   r   remove_optionr   rL   r   r   s      rP   remove_confzSpyderPluginV2.remove_conf  sw     :!+2?d''G$!  
 J$$Wf555OOVHe,,,,, "!rQ   c                 l    | j         (|r(|r(|                     t          |                     dS dS dS dS )z>
        Apply `options_set` to this plugin's widget.
        N)r*   after_configuration_updatelist)rL   options_setnotifys      rP   r   zSpyderPluginV2.apply_conf.  sV     :!k! C//[0A0ABBBBB "!!!C CrQ   c                     | j         9|| j        n|}|t          d          | j                             ||           dS dS )a9  
        Disable notifications for an option in the Spyder configuration system.

        Parameters
        ----------
        option: Union[str, Tuple[str, ...]]
            Name of the option, either a string or a tuple of strings.
        section: str
            Section in the configuration system.
        Nr|   )r*   r}   r   disable_notificationsr   s      rP   disable_confzSpyderPluginV2.disable_conf6  a     :!+2?d''G$!   J,,Wf===== "!rQ   c                     | j         9|| j        n|}|t          d          | j                             ||           dS dS )a9  
        Restore notifications for an option in the Spyder configuration system.

        Parameters
        ----------
        option: Union[str, Tuple[str, ...]]
            Name of the option, either a string or a tuple of strings.
        section: str
            Section in the configuration system.
        Nr|   )r*   r}   r   restore_notificationsr   s      rP   restore_confzSpyderPluginV2.restore_confJ  r   rQ   c                 <    | j                             ||           dS )z
        Show message in status bar.

        Parameters
        ----------
        message: str
            Message to display in the status bar.
        timeout: int
            Amount of time to display the message.
        N)sig_status_message_requestedemit)rL   messagetimeouts      rP   show_status_messagez"SpyderPluginV2.show_status_message^  s#     	)..w@@@@@rQ   c                     |r|                      |           t          j        t          t          j                             t          j                     dS )a  
        Show a message in main window's status bar and change the mouse
        pointer to Qt.WaitCursor when starting a long process.

        Parameters
        ----------
        message: str
            Message to show in the status bar when the long process starts.
        N)r   r   setOverrideCursorr
   r   
WaitCursorprocessEventsrL   r   s     rP   before_long_processz"SpyderPluginV2.before_long_processm  sP      	.$$W---&wr}'='=>>>"$$$$$rQ    c                     t          j                     |                     |d           t          j                     dS )a  
        Clear main window's status bar after a long process and restore
        mouse pointer to the OS deault.

        Parameters
        ----------
        message: str
            Message to show in the status bar when the long process finishes.
        i  )r   N)r   restoreOverrideCursorr   r   r   s     rP   after_long_processz!SpyderPluginV2.after_long_process}  sA     	*,,,  $ 777"$$$$$rQ   c                 d    | j         (t          | j                             dd                    S dS )aJ  
        Get the current color scheme.

        Returns
        -------
        dict
            Dictionary with properties and colors of the color scheme
            used in the Editor.

        Notes
        -----
        This is useful to set the color scheme of all instances of
        CodeEditor used by the plugin.
        N
appearanceselected)r*   r   r~   rY   s    rP   r   zSpyderPluginV2.get_color_scheme  s2     :!#DJNN<$L$LMMM "!rQ   c                 `    |                                   | j                                         dS )a  
        Initialize a plugin instance.

        Notes
        -----
        This method should be called to initialize the plugin, but it should
        not be overridden, since it internally calls `on_initialize` and emits
        the `sig_plugin_ready` signal.
        N)on_initializesig_plugin_readyr   rY   s    rP   
initializezSpyderPluginV2.initialize  s1     	""$$$$$rQ   c                 *    t          j        |           S )z@
        Provide icons from the theme and icon manager.
        )r   icon)r"   s    rP   create_iconzSpyderPluginV2.create_icon  s    
 x~~rQ   c                 N    |r
d}| j         }n	d}| j        }t          ||          S )a  
        Return plain or rich text font used in Spyder.

        Parameters
        ----------
        rich_text: bool
            Return rich text font (i.e. the one used in the Help pane)
            or plain text one (i.e. the one used in the Editor).

        Returns
        -------
        QFont
            QFont object to be passed to other Qt widgets.

        Notes
        -----
        All plugins in Spyder use the same, global font. This is a convenience
        method in case some plugins want to use a delta size based on the
        default one. That can be controlled by using FONT_SIZE_DELTA or
        RICH_FONT_SIZE_DELTA (declared in `SpyderPlugin`).
        	rich_fontfont)r   font_size_delta)RICH_FONT_SIZE_DELTAFONT_SIZE_DELTAr   )cls	rich_textr   r   s       rP   r   zSpyderPluginV2.get_font  s;    .  	2 F!6OOF!1OvGGGGrQ   c                 x    | j         | j         j        S t          j        d         g}t	          |          d         S )z
        Get command line options passed by the user when they started
        Spyder in a system terminal.

        See app/cli_options.py for the option names.
        Nr   )r(   _cli_optionssysargvr   )rL   sys_argvs     rP   get_command_line_optionsz'SpyderPluginV2.get_command_line_options  s9     :!:** }Hx((++rQ   c                       t          d          )z
        Return the plugin localized name.

        Returns
        -------
        str
            Localized name of the plugin.

        Notes
        -----
        This is a method to be able to update localization without a restart.
        zA plugin name must be defined!NotImplementedErrorr    rQ   rP   get_namezSpyderPluginV2.get_name  s     ""BCCCrQ   c                      t          d          )a  
        Return the plugin localized description.

        Returns
        -------
        str
            Localized description of the plugin.

        Notes
        -----
        This is a method to be able to update localization without a restart.
        z%A plugin description must be defined!r   rY   s    rP   get_descriptionzSpyderPluginV2.get_description  s     ""IJJJrQ   c                      t          d          )z~
        Return the plugin associated icon.

        Returns
        -------
        QIcon
            QIcon instance
        zA plugin icon must be defined!r   rY   s    rP   get_iconzSpyderPluginV2.get_icon   s     ""BCCCrQ   c                     t          | d          rt          d          t          dt          |            d          )z
        Setup the plugin.

        Notes
        -----
        All calls performed on this method should not call other plugins.
        registerzmregister was replaced by on_initialize, please check the Spyder 5.1.0 migration guide to get more informationzThe plugin z. is missing an implementation of on_initialize)rF   r   r   typerY   s    rP   r   zSpyderPluginV2.on_initialize  sb     4$$ 	H GH H H "$t**     	rQ   c                      d} d}| |fS )a  
        This method can be reimplemented to check compatibility of a plugin
        with the user's current environment.

        Returns
        -------
        (bool, str)
            The first value tells Spyder if the plugin has passed the
            compatibility test defined in this method. The second value
            is a message that must explain users why the plugin was
            found to be incompatible (e.g. 'This plugin does not work
            with PyQt4'). It will be shown at startup in a QMessageBox.
        Tr   r    )validr   s     rP   check_compatibilityz"SpyderPluginV2.check_compatibility  s     g~rQ   c                     dS )a  
        Actions to be performed the first time the plugin is started.

        It can also be used to perform actions that are needed only the
        first time this is loaded after installation.

        This method is called after the main window is visible.
        Nr    rY   s    rP   on_first_registrationz$SpyderPluginV2.on_first_registration1  	     	rQ   c                     dS )zj
        Actions to be performed after setup but before the main window's has
        been shown.
        Nr    rY   s    rP   before_mainwindow_visiblez(SpyderPluginV2.before_mainwindow_visible<  s	    
 	rQ   c                     dS )zQ
        Actions to be performed after the main window's has been shown.
        Nr    rY   s    rP   on_mainwindow_visiblez$SpyderPluginV2.on_mainwindow_visibleC  s	     	rQ   c                 R    t          | d          rt          j        d           dS dS )z
        Perform actions before the plugin is closed.

        This method **must** only operate on local attributes and not other
        plugins.
        
unregisterzThe unregister method was deprecated and it was replaced by `on_close`. Please see the Spyder 5.2.0 migration guide to get more information.N)rF   warningswarn)rL   
cancelables     rP   on_closezSpyderPluginV2.on_closeI  sC     4&& 	*M ) * * * * *	* 	*rQ   returnc                     dS )z
        Determine if a plugin can be closed.

        Returns
        -------
        close: bool
            True if the plugin can be closed, False otherwise.
        Tr    rY   s    rP   	can_closezSpyderPluginV2.can_closeV  s	     trQ   c                     dS )z
        This must be reimplemented by plugins that need to adjust their fonts.

        The following plugins illustrate the usage of this method:
          * spyder/plugins/help/plugin.py
          * spyder/plugins/onlinehelp/plugin.py
        Nr    rY   s    rP   rT   zSpyderPluginV2.update_fonta  	     	rQ   c                     dS )aT  
        This must be reimplemented by plugins that need to adjust their style.

        Changing from the dark to the light interface theme might
        require specific styles or stylesheets to be applied. When
        the theme is changed by the user through our Preferences,
        this method will be called for all plugins.
        Nr    rY   s    rP   update_stylezSpyderPluginV2.update_stylek  r   rQ   c                     dS )a  
        Perform necessary operations before setting up the container.

        This must be reimplemented by plugins whose containers emit signals in
        on_option_update that need to be connected before applying those
        options to our config system.
        Nr    rY   s    rP   rE   z'SpyderPluginV2.after_container_creationv  r   rQ   optionsc                     dS )ar  
        Perform additional operations after updating the plugin configuration
        values.

        This can be implemented by plugins that do not have a container and
        need to act on configuration updates.

        Parameters
        ----------
        options: List[Union[str, tuple]]
            A list that contains the options that were updated.
        Nr    )rL   r   s     rP   r   z)SpyderPluginV2.after_configuration_update  s	     	rQ   NF)T)NT)r   r   )V__name__
__module____qualname____doc__r8   rf   rg   r:   r}   	CONF_FILECONF_DEFAULTSCONF_VERSIONCONF_WIDGET_CLASSADDITIONAL_CONF_OPTIONSADDITIONAL_CONF_TABSCUSTOM_LAYOUTSrG   r   r   CONTEXT_NAMECAN_BE_DISABLEDr   r>   r   r@   rA   strintr   boolrB   dictrC   sig_mainwindow_resizedsig_mainwindow_movedobjectrD   sig_mainwindow_state_changed_CONF_NAME_MAPr'   rV   rZ   rJ   r]   r_   rb   ri   rq   rt   rv   r   r   r	   r   r   r   r   r   r   r   r   r   r   staticmethodr   classmethodr   r   r   r   r   r   r   r   r   r   r   r   rT   r   rE   r   r   tupler   __classcell__r0   s   @rP   r   r   3   s         D H H O
 L I M L 
 #  
 N H O L
 O !'
 vxx   #FHH $*6#s#3#3 
 $*6$<<  $VD\\< $VN33 "6,// '-fR&&;&;# $*6&>>  N7; 7; 7; 7; 7; 7;v   *# # #! ! !         @9 9 9; ; ;) ) ) (1$ < < < <8 
T#v	T#vs.2(, -  -  -   -D- - - -,C C C C> > > >(> > > >( 
T#YY	T#s^^A A A ^ YA% % % % % % %N N N$% % %   \ H H H [H>, , ,  D D \DK K K	D 	D 	D  &   \$	 	 	    * * * *	4 	 	 	 	  	 	 	  $uS%Z7H2I        rQ   r   c                   J    e Zd ZdZdZg ZdZdZ e            Z		  ee
          Z	  eee
          Z	  e            Z	  fdZ fdZd fd	Zd	 Zd
 Zd Z e            dd            Zd Zed             Zed             Zed             Zd Zd ZddZddZd Z  xZ!S )rw   zJ
    A Spyder plugin to enhance functionality with a dockable widget.
    NTFc                    t          | j        t                    st          d          | j        | _        t                                          ||           d | _        | j        | _	        | j	        }|t          d          t          |t                    st          d          | j        |_        | j        |_        |                    |                                            |                    | j                   |                                 |j                            | j                   |j                            | j                   d S )NzBA SpyderDockablePlugin must define a valid WIDGET_CLASS attribute!)rM   z-A dockable plugin must define a WIDGET_CLASS!zMThe WIDGET_CLASS of a dockable plugin must be a subclass of PluginMainWidget!)
issubclassWIDGET_CLASSr   r   r:   r&   r'   	_shortcutr2   r)   r;   DISABLE_ACTIONS_WHEN_HIDDENRAISE_AND_FOCUSset_iconr   set_namer8   render_toolbarssig_toggle_view_changedr?   sig_update_ancestor_requested)rL   r$   rM   widgetr0   s       rP   r'   zSpyderDockablePlugin.__init__  s_   $+-=>> 	     $0}===  > ?A A A &"233 	% $% % % .2-M*!%!5(((	"""
 	    	&..t/KLLL,44.	0 	0 	0 	0 	0rQ   c                     |                                                                   t                                          |           dS )a'  
        Show a message in main window's status bar, change the mouse pointer
        to Qt.WaitCursor and start spinner when starting a long process.

        Parameters
        ----------
        message: str
            Message to show in the status bar when the long process starts.
        N)
get_widgetstart_spinnerr&   r   rL   r   r0   s     rP   r   z(SpyderDockablePlugin.before_long_process  s?     	'')))##G,,,,,rQ   r   c                     t                                          |           |                                                                  dS )a  
        Clear main window's status bar after a long process, restore mouse
        pointer to the OS deault and stop spinner.

        Parameters
        ----------
        message: str
            Message to show in the status bar when the long process finishes.
        N)r&   r   r  stop_spinnerr  s     rP   r   z'SpyderDockablePlugin.after_long_process  s?     	""7+++&&(((((rQ   c                 <    | j         t          d          | j         S )z0
        Return the plugin main widget.
        Nz)Dockable Plugin must have a WIDGET_CLASS!)r)   r   rY   s    rP   r  zSpyderDockablePlugin.get_widget  s#     < !LMMM|rQ   c                 R    |                                                                   dS )zG
        Update plugin title, i.e. dockwidget or window title.
        N)r  update_titlerY   s    rP   r  z!SpyderDockablePlugin.update_title  s&     	&&(((((rQ   c                 T    |                                                      |           dS )zG
        Update margins of main widget inside dockable plugin.
        N)r  update_margins)rL   margins     rP   r  z#SpyderDockablePlugin.update_margins$  s(     	((00000rQ   c                 r    |                                  j        | j                            | |           dS dS )zN
        Switch to plugin and define if focus should be given or not.
        N)r  windowwidgetsig_switch_to_plugin_requestedr   )rL   force_focuss     rP   switch_to_pluginz%SpyderDockablePlugin.switch_to_plugin*  s>    
 ??)1/44T;GGGGG 21rQ   c                 T    |                                                      |           dS )zM
        Update the ancestor/parent of child widgets when undocking.
        N)r  set_ancestor)rL   ancestor_widgets     rP   r"  z!SpyderDockablePlugin.set_ancestor2  s(     	&&77777rQ   c                 4    |                                  j        S r   )r  
dockwidgetrY   s    rP   r%  zSpyderDockablePlugin.dockwidget:  s      ++rQ   c                 N    |                                                                  S r   )r  get_options_menurY   s    rP   options_menuz!SpyderDockablePlugin.options_menu>  s      11333rQ   c                 4    |                                  j        S r   )r  toggle_view_actionrY   s    rP   r*  z'SpyderDockablePlugin.toggle_view_actionB  s      33rQ   c                 P    |                                                      |          S r   )r  create_dockwidget)rL   
mainwindows     rP   r,  z&SpyderDockablePlugin.create_dockwidgetF  s       22:>>>rQ   c                 R    |                                                                   d S r   )r  create_windowrY   s    rP   r/  z"SpyderDockablePlugin.create_windowI  s$    '')))))rQ   c                 V    |                                                      |           d S )N)save_undocked)r  close_window)rL   r1  s     rP   r2  z!SpyderDockablePlugin.close_windowL  s)    &&]&CCCCCrQ   c                 V    |                                                      ||           d S r   )r  change_visibility)rL   stater  s      rP   r4  z&SpyderDockablePlugin.change_visibilityO  s(    ++E;?????rQ   c                 T    |                                                      |           d S r   )r  toggle_view)rL   r   s     rP   r7  z SpyderDockablePlugin.toggle_viewR  s&    %%e,,,,,rQ   r   r   )"r   r   r   r   r  TABIFYr  r	  r   sig_focus_changedr   r  r   r  r  r'   r   r   r  r  r  r	   r   r"  propertyr%  r(  r*  r,  r/  r2  r4  r7  r  r  s   @rP   rw   rw     s         L F #'
 O  %fTll &,VFD%9%9" %+FHH!'0 '0 '0 '0 '0V- - - - -) ) ) ) ) )  ) ) )1 1 1 
TVVH H H VH8 8 8 , , X, 4 4 X4 4 4 X4? ? ?* * *D D D D@ @ @ @- - - - - - -rQ   rw   )8r   collectionsr   r.   loggingr+   os.pathr,   rH   r   typingr   r   r   qtpy.QtCorer   r   r   r	   
qtpy.QtGuir
   qtpy.QtWidgetsr   spyder.api.config.mixinsr   spyder.api.exceptionsr   %spyder.api.plugin_registration.mixinsr   spyder.api.translationsr   spyder.api.widgets.main_widgetr   spyder.api.widgets.mixinsr   r   spyder.app.cli_optionsr   spyder.config.guir   r   spyder.config.userr   spyder.utils.icon_managerr   spyder.utils.image_path_managerr   enumr   old_apir   	getLoggerr   loggerr   rw   r    rQ   rP   <module>rQ     sY    $ # # # # #   				       



          2 1 1 1 1 1 1 1 1 1 1 1       ' ' ' ' ' ' A @ @ @ @ @ 0 0 0 0 0 0 F F F F F F % % % % % % ; ; ; ; ; ; 7 7 7 7 7 7 7 7 7 7 7 7 . . . . . . 8 8 8 8 8 8 8 8 ( ( ( ( ( ( ) ) ) ) ) ) > > > > > >       ' ' ' ' ' ' 
	8	$	$Z Z Z Z ZW/1L)Z Z ZzC- C- C- C- C-> C- C- C- C- C-rQ   