Mini Shell

Direktori : /lib64/gedit/plugins/externaltools/__pycache__/
Upload File :
Current File : //lib64/gedit/plugins/externaltools/__pycache__/windowactivatable.cpython-36.opt-1.pyc

3

6nZ{�@s�dZddlmZmZmZmZmZddlmZddl	m
Z
dd	lmZdd
l
Ty&ddlZejd�ejd�ejZWnd
d�ZYnXGdd�de�ZGdd�dejej�ZdS)�ExternalToolsPlugin�OutputPanel�Capture�
UniqueById�)�GLib�Gio�GObject�Gtk�Gedit�)�ToolLibrary)r)r)�*NZgeditcCs|S)N�)�srr�;/usr/lib64/gedit/plugins/externaltools/windowactivatable.py�<lambda>!srcsLeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�ToolActionscs2tt|�j�||_||_||_i|_|j�dS)N)�superr�__init__�_library�_window�_panel�
_action_tools�update)�self�library�window�panel)�	__class__rrr$szToolActions.__init__cCs|j�dS)N)�remove)rrrr�
deactivate-szToolActions.deactivatecCs.x"|jj�D]\}}|jj|�qWi|_dS)N)r�itemsrZ
remove_action)r�name�toolrrrr0szToolActions.removecCsnxht|jdd�d�D]R}dt|�t|j�f}||j|<tj|d�}|jdt|j	|j
|�|j	j|�qWdS)NcSs
|jj�S)N)r"�lower)�xrrrr6sz/ToolActions._insert_directory.<locals>.<lambda>)�keyzexternal-tool-%X-%X)r"Zactivate)�sortedZtools�idr"rrZSimpleActionZconnectZcapture_menu_actionrrZ
add_action)rZ	directoryr#Zaction_name�actionrrr�_insert_directory5s
zToolActions._insert_directorycCs*|j�|j|jj�|j|jj��dS)N)rr*rZtree�filterr�get_active_document)rrrrr?szToolActions.updatecCs<|js
dS|rd|jkrdS|r4|j�|jkr4dSdSdS)NTZplainF)Z	languagesZget_id)r�language�itemrrr�filter_languageDszToolActions.filter_languagec	Cs�|dkrd}d}d}n&|j�j�dk	}|j�j�}|j�}d|dk	|oL||oR|||d�}xB|jj�D]4\}}|jj|�}|rj|j||j	o�|j
||��qjWdS)NFT)�always�allZlocal�remote�titledZuntitled)Zget_fileZget_locationZis_localZget_languagerr!rZ
lookup_actionZset_enabledZ
applicabilityr/)	rZdocumentr3r2r-Zstatesr"r#r)rrrr+Ps$
zToolActions.filter)�__name__�
__module__�__qualname__rr rr*rr/r+�
__classcell__rr)rrr#s	
rc@sFeZdZdZejejd�Zdd�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
S)�WindowActivatableZExternalToolsWindowActivatable)�typecCstjj|�d|_dS)N)r�Objectr�actions)rrrrroszWindowActivatable.__init__cCs\||j_t�|_t|jj�|j�|_t|j|j|j�|_	|jj
�}|j|jjdt
d��dS)NZGeditExternalToolsShellOutputzTool Output)r�!external_tools_window_activatablerrrZplugin_infoZget_data_dir�_output_bufferrr;�get_bottom_panelZ
add_titledr�_)r�bottomrrr�do_activatess
zWindowActivatable.do_activatecCs |jdk	r|jj|jj��dS)N)r;r+rr,)rrrr�do_update_state�s
z!WindowActivatable.do_update_statecCs.|jj�|jj�}|j|jj�d|j_dS)N)r;r rr>rr=rr<)rr@rrr�
do_deactivate�s

zWindowActivatable.do_deactivatecCs|jj�dS)N)r;r)rrrr�update_actions�sz WindowActivatable.update_actionsN)r4r5r6Z__gtype_name__rZPropertyr
ZWindowrrrArBrCrDrrrrr8js
r8)rrrr)�__all__Z
gi.repositoryrrrr	r
rrZoutputpanelrZcapturerZ	functions�gettext�bindtextdomain�
textdomainr?�objectrr:r8rrrr�<module>s


G