a
    ©ˆc  ã                   @   s.   d Z ddlZddlZddlZejdd„ ƒZdS )z4 Utilities for supporting Envisage's demo examples.
é    Nc              	   c   sJ   t j t  | ¡¡} z$tj d| ¡ dV  W tj | ¡ ntj | ¡ 0 dS )aB   Context manager to temporarily insert the directory containing
    the demo script to sys.path such that demo examples can be run using
    local packages.

    This function should only be used by Envisage example files.

    Parameters
    ----------
    path : Path-like
        Path to the demo script to be run.
    r   N)ÚosÚpathÚdirnameÚfspathÚsysÚinsertÚremove)r   © r	   úZ/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/envisage/examples/_demo.pyÚ	demo_path   s
    r   )Ú__doc__Ú
contextlibr   r   Úcontextmanagerr   r	   r	   r	   r
   Ú<module>
   s
   