Ë
    ŽODg¶  ã                   óÒ   — d dl mZmZmZmZ ddlmZ ddlmZ d dl	Z	 e	j                  dd¬«      j                  Zd	Z G d
„ dej                  ej                  ej                  «      Zy)é    )ÚGObjectÚGtkÚXviewerÚPeasGtké   )ÚPythonConsole)ÚPythonConsoleConfigWidgetNzxviewer-pluginsT)Úfallbacka  
    <ui>
        <menubar name="MainMenu">
            <menu name="ToolsMenu" action="Tools">
                <separator/>
                <menuitem name="PythonConsole" action="PythonConsole"/>
                <separator/>
            </menu>
        </menubar>
    </ui>
    c                   ón   — e Zd Z ej                  ej                  ¬«      ZdZd„ Z	d„ Z
d„ Zd„ Zd„ Zd„ Zy)	ÚPythonConsolePlugin)ÚtypeNc                 ó^   — t         j                  j                  | «       d | _        d| _        y ©Nr   )r   ÚObjectÚ__init__Úconsole_windowÚui_id)Úselfs    ú2/usr/lib/xviewer/plugins/pythonconsole/__init__.pyr   zPythonConsolePlugin.__init__7   s#   € Ü�‰×Ñ Ô%Ø"ˆÔØˆ�
ó    c                 óZ  — | j                   j                  «       }t        j                  d¬«      | _        | j                  j                  dd t        d«      d d | j                  fg| j                   «       |j                  | j                  d«       |j                  t        «      | _        y )Nr   )ÚnamezP_ython Consoler   )ÚwindowÚget_ui_managerr   ÚActionGroupÚaction_groupÚadd_actionsÚ_Ú
console_cbÚinsert_action_groupÚadd_ui_from_stringÚ_UI_STRr   ©r   Ú
ui_managers     r   Údo_activatezPythonConsolePlugin.do_activate<   s‹   € Ø—[‘[×/Ñ/Ó1ˆ
ÜŸO™O°ÔAˆÔØ×Ñ×%Ñ%¨¸ÜÐÓ  $¨¨d¯o©oð(?ð '@ØAEÇÁô	Nà×&Ñ& t×'8Ñ'8¸!Ô<Ø×2Ñ2´7Ó;ˆ�
r   c                 ó.  — | j                   j                  «       }|j                  | j                  «       d| _        |j	                  | j
                  «       d | _        |j                  «        | j                  �| j                  j                  «        y y r   )	r   r   Ú	remove_uir   Úremove_action_groupr   Úensure_updater   Údestroyr#   s     r   Údo_deactivatez!PythonConsolePlugin.do_deactivateD   sx   € Ø—[‘[×/Ñ/Ó1ˆ
Ø×Ñ˜TŸZ™ZÔ(ØˆŒ
Ø×&Ñ& t×'8Ñ'8Ô9Ø ˆÔØ× Ñ Ô"Ø×ÑÐ*Ø×Ñ×'Ñ'Õ)ð +r   c                 óœ  — | j                   �st        j                  «       | _         t        t        t
        |dœ¬«      }|j                  dd«       |j                  dd«       | j                   j                  t        d«      «       | j                   j                  |«       | j                   j                  d| j                  «       | j                   j                  «        | j                   j                  |«       | j                   j                  d	«       n| j                   j                  «        | j                   j!                  «        y )
N)Ú__builtins__r   r   )Ú	namespaceiX  i�  zGprint("You can access the main window through 'window' :\n%s" % window)FzPython Consolezdelete-eventT)r   r   ÚWindowr   r-   r   Úset_size_requestÚevalÚ	set_titler   ÚaddÚconnectÚon_delete_cbÚshow_allÚset_transient_forÚset_destroy_with_parentÚ
grab_focus)r   Úactionr   Úconsoles       r   r   zPythonConsolePlugin.console_cbN   s  € Ø×"Ó"Ü"%§*¡*£,ˆDÔÜ#Ä,Ü=DØ<Bñ1Dô EˆGð ×$Ñ$ S¨#Ô.Ø�L‰Lð 8Ø9>ô@à×Ñ×)Ñ)¬!Ð,<Ó*=Ô>Ø×Ñ×#Ñ# GÔ,à×Ñ×'Ñ'¨¸×8IÑ8IÔJØ×Ñ×(Ñ(Ô*Ø×Ñ×1Ñ1°&Ô9Ø×Ñ×7Ñ7¸Õ=à×Ñ×(Ñ(Ô*Ø×Ñ×&Ñ&Õ(r   c                 ó2   — |j                  «        d | _        y ©N)r*   r   )r   r   Úevents      r   r5   z PythonConsolePlugin.on_delete_cbb   s   € Ø�‰ÔØ"ˆÕr   c                 óh   — t        | j                  j                  «       «      }|j                  «       S r=   )r	   Úplugin_infoÚget_data_dirÚconfigure_widget)r   Úconfig_widgets     r   Údo_create_configure_widgetz.PythonConsolePlugin.do_create_configure_widgetf   s*   € Ü1°$×2BÑ2B×2OÑ2OÓ2QÓRˆà×-Ñ-Ó/Ð/r   )Ú__name__Ú
__module__Ú__qualname__r   Úpropertyr   r/   r   r   r   r%   r+   r   r5   rD   © r   r   r   r   1   s=   „ ð ˆW×Ñ 7§>¡>Ô2€FØ€Lòò
<ò*ò)ò(#ó0r   r   )Úgi.repositoryr   r   r   r   r;   r   Úconfigr	   ÚgettextÚtranslationr   r"   r   ÚWindowActivatableÚConfigurabler   rI   r   r   ú<module>rP      sX   ð÷8 9Ó 8å "Ý -ã Ø€G×ÑÐ)°DÔ9×AÑA€ð
€ô80˜'Ÿ.™.¨'×*CÑ*CÀW×EYÑEYõ 80r   