3
=Ad]‰  ã               @   s<   d Z ddlmZmZ ddlmZ eeƒG dd„ deƒƒZdS )z, The default import manager implementation. é    )Ú	HasTraitsÚprovidesé   )ÚIImportManagerc               @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚImportManagerzæ The default import manager implementation.

    Its just a guess, but I think using an import manager to do all imports
    will make debugging easier (as opposed to just letting imports happen from
    all over the place).

    c             C   sz   d|kr.|j dƒ\}}| j|ƒ}t||jƒ}nB|j dƒ}dj|dd… ƒ}|d }t|tƒ tƒ |gƒ}t||ƒ}|| _	|S )z9 Import the symbol defined by the specified symbol path. ú:Ú.Nr   éÿÿÿÿr	   )
ÚsplitÚ_import_moduleÚevalÚ__dict__ÚjoinÚ
__import__ÚglobalsÚlocalsÚgetattrZsymbol_imported)ÚselfZsymbol_pathÚmodule_nameZsymbol_nameÚmoduleÚsymbolÚ
components© r   ús/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.6/site-packages/envisage-4.7.2-py3.6.egg/envisage/import_manager.pyÚimport_symbol   s    


zImportManager.import_symbolc             C   s6   t |ƒ}|jdƒ}x|dd… D ]}t||ƒ}q W |S )zô Import the module with the specified (and possibly dotted) name.

        Returns the imported module.

        This method is copied from the documentation of the '__import__'
        function in the Python Library Reference Manual.

        r   r   N)r   r
   r   )r   r   r   r   Ú	componentr   r   r   r   7   s
    

zImportManager._import_moduleN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   r   N)r   Z
traits.apir   r   Zi_import_managerr   r   r   r   r   r   Ú<module>   s   