a
    §ˆc_  ã                   @   s0   d Z ddlZddlmZ d	dd„Zd
dd„ZdS )zÞ Functions to determine resource locations from the call stack.

This type of resource location is normally requested from the constructor for
an object whose resources are relative to the module constructing the object.

é    N©Úget_resource_pathé   c                 C   sD   t  | ¡j dd¡}d|v r4d | d¡dd… ¡}t j |¡}|S )a	  Return a module reference calculated from the caller's stack.

    Note that what we want is the reference to the package containing the
    module in the stack.  This is because we need a directory to search
    for our default resource sub-dirs as children.

    Ú__name__Ú__main__Ú.Néÿÿÿÿ)ÚsysÚ	_getframeÚ	f_globalsÚgetÚjoinÚsplitÚmodules)ÚlevelÚmodule_nameÚmodule© r   ú`/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/pyface/resource/resource_path.pyÚresource_module   s
    r   c                 C   s   t | d ƒS )z@Return a resource path calculated from the caller's stack.

    é   r   )r   r   r   r   Úresource_path&   s    r   )r   )r   )Ú__doc__r	   Ztraits.trait_baser   r   r   r   r   r   r   Ú<module>
   s   
