
    G@d                         d Z ddlmZ ddlmZ ddlmZmZ ddl	m
Z
mZ ddlmZ ddlmZ ddlmZ  G d	 d
          Z G d de          ZdS )z
Breakpoint Plugin.
    N)Signal)PluginsSpyderDockablePlugin)on_plugin_availableon_plugin_teardown_)BreakpointWidget)ApplicationMenusc                       e Zd ZdZdS )BreakpointsActionslist_breakpoints_actionN)__name__
__module____qualname__ListBreakpoints     Alib/python3.11/site-packages/spyder/plugins/breakpoints/plugin.pyr   r      s        /OOOr   r   c                      e Zd ZdZdZej        gZej        gZ	ej
        gZeZeZdZ e            Z	  eee          Z	  eeee          Z	  e            Z	 ed             Zd Zd Zd Z eej                  d	             Z eej                  d
             Z eej                  d             Z  eej                  d             Z!d Z"ddZ#dS )Breakpointsz!
    Breakpoint list Plugin.
    breakpointsFc                       t          d          S )Nr   r   r   r   r   get_namezBreakpoints.get_nameY   s    r   c                      t          d          S )Nz*Manage code breakpoints in a unified pane.r   selfs    r   get_descriptionzBreakpoints.get_description]   s    =>>>r   c                 ,    |                      d          S )Nr   )create_iconr   s    r   get_iconzBreakpoints.get_icon`   s    ...r   c                    |                                  }|j                            | j                   |j                            | j                   |j                            | j                   |j                            | j                   |                     t          j        t          d          | j
        |                                            d S )NzList breakpoints)	triggeredicon)
get_widget#sig_clear_all_breakpoints_requestedconnectsig_clear_breakpoint_requestedsig_edit_goto_requested$sig_conditional_breakpoint_requestedcreate_actionr   r   r	   switch_to_pluginr!   )r   widgets     r   on_initializezBreakpoints.on_initializec   s    ""2::4	6 	6 	6-55/	1 	1 	1&..t/KLLL3;;5	7 	7 	7 	. !!+	 	 	
 	
 	
 	
 	
r   )pluginc                    |                                  }|                     t          j                  }|                     t
          j                  }|j                            | j	                   |j
                            |j                   |j                            |j                   |j                            |j                   |j                            |j                   |xj        |gz  c_        d S N)r%   
get_pluginr   Editor
get_actionr   r   breakpoints_savedr'   set_datar&   clear_all_breakpointsr(   clear_breakpointr)   loadr*   "set_or_edit_conditional_breakpointpythonfile_dependent_actionsr   r-   editorlist_actions       r   on_editor_availablezBreakpoints.on_editor_availableu   s    ""00oo&8&HII 	 ((7772::(	* 	* 	*-55f6MNNN&..v{;;;3;;5	7 	7 	7 	++}<++++r   c                     |                      t          j                  }|                     t          j                  }|                    |t          j                   d S N)menu_id)	r2   r   MainMenur4   r   r   add_item_to_application_menur   Debug)r   mainmenur>   s      r   on_main_menu_availablez"Breakpoints.on_main_menu_available   s[    ??7#344oo&8&HII--!1!7 	. 	9 	9 	9 	9 	9r   c                    |                                  }|                     t          j                  }|                     t
          j                  }|j                            | j	                   |j
                            |j                   |j                            |j                   |j                            |j                   |j                            |j                   |j                            |           d S r1   )r%   r2   r   r3   r4   r   r   r5   
disconnectr6   r&   r7   r(   r8   r)   r9   r*   r:   r;   remover<   s       r   on_editor_teardownzBreakpoints.on_editor_teardown   s    ""00oo&8&HII ++DM:::2==(	* 	* 	*-88#	% 	% 	%&11&+>>>3>>5	7 	7 	7 	+22;?????r   c                     |                      t          j                  }|                    t          j        t          j                   d S rA   )r2   r   rC   !remove_item_from_application_menur   r   r   rE   )r   rF   s     r   on_main_menu_teardownz!Breakpoints.on_main_menu_teardown   sN    ??7#34422.8H8N 	3 	P 	P 	P 	P 	Pr   c                 z   |                      di d          }t          |                                          D ]}t          j        |          s|                    |           ,t          j        |          }||k    r:|                    |          }||v r||                             |           {|||<   |S )z?
        Load breakpoint data from configuration file.
        r   run)defaultsection)get_conflistkeysospisfilepopnormcaseextend)r   breakpoints_dictfilenamenew_filenamebps        r   
_load_datazBreakpoints._load_data   s      == ) 
 

 -224455 	8 	8H:h''  $$X...<11Lx''%))(33#333$\299"====57$\2r   Nc                     ||                                  }|                                                     |           dS )z
        Set breakpoint data on widget.

        Parameters
        ----------
        data: dict, optional
            Breakpoint data to use. If None, data from the configuration
            will be loaded. Default is None.
        N)r_   r%   r6   )r   datas     r   r6   zBreakpoints.set_data   s<     <??$$D""4(((((r   r1   )$r   r   r   __doc__NAMEr   r3   REQUIRESrC   OPTIONALHelpTABIFYr
   WIDGET_CLASSCONF_SECTION	CONF_FILEr   r&   strintr(   r)   r*   staticmethodr   r   r!   r.   r   r?   rG   r   rK   rN   r_   r6   r   r   r   r   r   $   s         DH !Hl^F#LLI +1&(('
 &,VC%5%5"	 %fS#s33 ,2688(     \ ? ? ?/ / /
 
 
$ ///= = 0/="  01119 9 219 w~...@ @ /.@  w/000P P 10P     4) ) ) ) ) )r   r   )rb   os.pathpathrV   qtpy.QtCorer   spyder.api.pluginsr   r   )spyder.api.plugin_registration.decoratorsr   r   spyder.api.translationsr	   .spyder.plugins.breakpoints.widgets.main_widgetr
   spyder.plugins.mainmenu.apir   r   r   r   r   r   <module>rv      s   
             = < < < < < < <- - - - - - - - % % % % % % K K K K K K 8 8 8 8 8 8
0 0 0 0 0 0 0 0j) j) j) j) j)& j) j) j) j) j)r   