
    G@d                         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mZ e
j        Z G d d	          Z G d
 de          ZdS )z
Tours Container.
    )OrderedDict)SpyderAPIError)_)PluginMainContainer)TourIdentifiers)AnimatedTourOpenTourDialogc                       e Zd ZdZdZdS )TourActionsz
    Tours actions.
    z	show tourN)__name__
__module____qualname____doc__ShowTour     >lib/python3.11/site-packages/spyder/plugins/tours/container.pyr   r      s          HHHr   r   c                   B     e Zd ZdZd	 fd	Zd Zd Zd Zd Zd Z	 xZ
S )
ToursContainerz
    Tours container.
    Nc                     t                                          |||           |j         _        t	                       _        t	                       _        t           j                   _        t            fd           _
                             t          j        t          d                               d           fd           _        d S )N)parentc                  8                          t                    S N	show_tourDEFAULT_TOURselfs   r   <lambda>z)ToursContainer.__init__.<locals>.<lambda>0   s    $..66 r   z	Show tourtourc                  8                          t                    S r   r   r   s   r   r   z)ToursContainer.__init__.<locals>.<lambda>6   s    dnn\:: r   )texticon	triggered)super__init__main_mainr   _tours_tour_titlesr   _tour_widgetr	   _tour_dialogcreate_actionr   r   r   create_icontour_action)r   namepluginr   	__class__s   `   r   r&   zToursContainer.__init__'   s    vf555[
!mm'MM(44*66668 8  -- ;!!&))::::	 . 
 
r   c                 V    |                      dt          d                    | _        d S )N
tours_menuzInteractive tours)create_menur   r4   r   s    r   setupzToursContainer.setup;   s+    **!/002 2r   c                     d S r   r   r   s    r   update_actionszToursContainer.update_actions?   s    r   c                       j         v r"t          d                                        | j         <   | j        <                        | fd          }                     | j                   dS )a  
        Register a new interactive tour on spyder.

        Parameters
        ----------
        tour_id: str
            Unique tour string identifier.
        title: str
            Localized tour name.
        tour_data: dict
            The tour steps.
        z.Tour with id '{}' has already been registered!c                  .                                    S r   )r   )r   tour_ids   r   r   z.ToursContainer.register_tour.<locals>.<lambda>[   s    dnnW55 r   )r"   r$   )menuN)r)   r   formatr*   r-   add_item_to_menur4   )r   r;   title	tour_dataactions   ``   r   register_tourzToursContainer.register_tourD   s     dk!! @GG     )G%*'"##55555 $ 
 

 	f4?;;;;;r   c                     | j                                          | j        |         }d|d}| j                            ||| j                   | j                                         dS )z
        Show interactive tour.

        Parameters
        ----------
        tour_id: str
            Unique tour string identifier.
        r   )lastr    N)sig_unmaximize_plugin_requestedemitr)   r+   set_tourr(   
start_tour)r   r;   r@   dics       r   r   zToursContainer.show_tour_   sj     	,11333K(	),,""7C<<<$$&&&&&r   c                 j    | j                                          | j                                          dS )zT
        Show message about starting the tour the first time Spyder starts.
        N)r,   showraise_r   s    r   show_tour_messagez ToursContainer.show_tour_messagen   s4     	     """""r   r   )r   r   r   r   r&   r6   r8   rB   r   rM   __classcell__)r2   s   @r   r   r   "   s         
 
 
 
 
 
(2 2 2  
< < <6' ' '# # # # # # #r   r   N)r   collectionsr   spyder.api.exceptionsr   spyder.api.translationsr   !spyder.api.widgets.main_containerr   spyder.plugins.tours.toursr   spyder.plugins.tours.widgetsr   r	   IntroductionTourr   r   r   r   r   r   <module>rV      s     $ # # # # # 1 0 0 0 0 0 % % % % % % A A A A A A 6 6 6 6 6 6 E E E E E E E E /       Q# Q# Q# Q# Q#( Q# Q# Q# Q# Q#r   