a
    …Ï?eG  ã                   @   s2   d dl mZ dd„ Zdd„ Zddd„Zd	d
„ ZdS )é    )Úuntypifyc                 C   s`   |  dd¡\}}t| ƒD ]*}d |d ¡|kr|d |kr|  S qtdt|ƒ› d|› �ƒ‚dS )z>In list of types return one with matching fully qualified nameÚ.é   ÚpathÚnamezno oschema type found: ú N)Úrsplitr   ÚjoinÚKeyErrorÚtype)ÚtypesZfqnr   r   Útyp© r   úU/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/moo/templates/util.pyÚ	find_type   s
    
r   c                 C   s   ddl m} || ƒ dS )Nr   )ÚpprintÚ )Zrich.prettyr   )Útextr   r   r   r   Údebug   s    r   r   c                 C   s&   | s
t ƒ S t| tƒr|  |¡S t | ƒS )z1Return thing as a list.  If string split on delim)ÚlistÚ
isinstanceÚstrÚsplit)ÚthingÚdelimr   r   r   Úlistify   s
    

r   c                 C   sF   t | ƒ} |s| S t |ƒ}| d |d kr,| S t| dd… |dd… ƒS )zIRemove as much of starting from start of longpath as can before divergingr   r   N)r   Úrelpath)ZlongpathZstartingr   r   r   r      s    r   N)r   )Zmoo.oschemar   r   r   r   r   r   r   r   r   Ú<module>   s   
	