3
6ßL]¯  ã               @   s`   d Z ddlmZmZ ddlmZmZ ddlmZm	Z	m
Z
 ddlmZ dd„ ZG d	d
„ d
eƒZdS )z A naming system explorer. é    )ÚBindingÚ	PyContext)ÚPythonShellÚSplitApplicationWindow)ÚFloatÚInstanceÚStré   )Ú
NamingTreec             C   s*   t dt| d�d�}t|dd�}|jƒ  dS )	z+ View a Python object as a naming context. Úroot)Ú	namespace)ÚnameÚobjé°  é�  )r   ÚsizeN)r   r   )r   r   ÚExplorerÚopen)r   r   Zexplorer© r   úA/tmp/pip-install-5sebvq2j/apptools/apptools/naming/ui/explorer.pyÚexplore   s    r   c               @   sP   e Zd ZdZedƒZedƒZedƒZe	e
ƒZdd„ Zdd„ Zd	d
„ Zdd„ ZdS )r   z The main application window. zNaming System ExplorerZverticalg333333Ó?c             C   s   | j || jƒS )z; Creates the left hand side or top depending on the style. )Ú_create_treer   )ÚselfÚparentr   r   r   Ú_create_lhs<   s    zExplorer._create_lhsc             C   s
   | j |ƒS )z< Creates the panel containing the selected preference page. )Ú_create_python_shell)r   r   r   r   r   Ú_create_rhsA   s    zExplorer._create_rhsc             C   s   t ||d� | _}|jS )z Creates the tree. )r   )r
   Ú_treeÚcontrol)r   r   r   Útreer   r   r   r   J   s    zExplorer._create_treec             C   sR   t |ƒ | _}|jd| jƒ |jd| jƒ |jd| ƒ |jdtƒ |jdƒ |jS )z Creates the Python shell. ZwidgetÚwZwindowr   z!from apptools.naming.api import *)r   Z_python_shellÚbindr   r   Zexecute_commandr   )r   r   Zpython_shellr   r   r   r   Q   s    
zExplorer._create_python_shellN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚtitleÚ	directionr   Zratior   r   r   r   r   r   r   r   r   r   r   r   &   s   	r   N)r%   Zapptools.naming.apir   r   Z
pyface.apir   r   Z
traits.apir   r   r   Znaming_treer
   r   r   r   r   r   r   Ú<module>   s   