o
    Lpi                  	   @  s   U d dl mZ d dlZd dlmZmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZ dd	d
ddZded< d
gd	gdgdgdgdgdgdgdZded< dZG dd dZG dd dZdd ZdS )    )annotationsN)
ModuleSpec
PathFinder)all_suffixes)spec_from_file_location)chain)Pathz/home/ubuntu/vibevoice/Figuresz/home/ubuntu/vibevoice/demoz/home/ubuntu/vibevoice/docsz /home/ubuntu/vibevoice/vibevoice)Figuresdemodocs	vibevoicezdict[str, str]MAPPINGz"/home/ubuntu/vibevoice/demo/voicesz#/home/ubuntu/vibevoice/demo/examplez)/home/ubuntu/vibevoice/demo/text_examplesz2/home/ubuntu/vibevoice/demo/voices/streaming_modelz(/home/ubuntu/vibevoice/vibevoice/configs)r   r
   r	   zdemo.voiceszdemo.examplezdemo.text_exampleszdemo.voices.streaming_modelzvibevoice.configszdict[str, list[str]]
NAMESPACESz1__editable__.vibevoice-0.1.0.finder.__path_hook__c                   @  s*   e Zd ZeddddZedd
dZdS )_EditableFinderNfullnamestrreturnModuleSpec | Nonec                 C  sT   |t v rt | }| |t|S |d\}}}|r(|t v r(tj|t | gdS d S )N.)path)r   
_find_specr   
rpartitionr   	find_spec)clsr   r   targetpkg_pathparent_child r   W/home/ubuntu/.local/lib/python3.10/site-packages/__editable___vibevoice_0_1_0_finder.pyr      s   z_EditableFinder.find_speccandidate_pathr   c                   sH    d } fddt  D }t|g|D ]}| r!t||  S qd S )Nz__init__.pyc                 3  s    | ]}  |V  qd S N)with_suffix).0xr!   r   r    	<genexpr>$       z-_EditableFinder._find_spec.<locals>.<genexpr>)module_suffixesr   existsr   )r   r   r!   init
candidates	candidater   r&   r    r   !   s   z_EditableFinder._find_spec)NNr   r   r   r   )r   r   r!   r   r   r   )__name__
__module____qualname__classmethodr   r   r   r   r   r    r      s
    r   c                   @  sF   e Zd ZedddZeddd	ZeddddZedddZd
S )_EditableNamespaceFinderr   type[_EditableNamespaceFinder]c                 C  s   |t kr| S tr"   )PATH_PLACEHOLDERImportError)r   r   r   r   r    
_path_hook,   s   z#_EditableNamespaceFinder._path_hookr   r   	list[str]c                 C  s*   t | }|s|tv rt| g}g |tS r"   )r   r   r5   )r   r   pathsr   r   r    _paths2   s   
z_EditableNamespaceFinder._pathsNr   c                 C  s*   |t v rt|d dd}| ||_|S d S )NT)
is_package)r   r   r:   submodule_search_locations)r   r   r   specr   r   r    r   =   s
   z"_EditableNamespaceFinder.find_specNonec                 C  s   d S r"   r   )r   	_fullnamer   r   r    find_moduleE   s   z$_EditableNamespaceFinder.find_module)r   r4   )r   r   r   r8   r"   r.   )r   r>   )r/   r0   r1   r2   r7   r:   r   r@   r   r   r   r    r3   +   s    
r3   c                   C  sh   t dd tjD stjt tsd S t dd tjD s%tjtj t	tj
vr2tj
t	 d S d S )Nc                 s  s    | ]}|t kV  qd S r"   )r   )r$   finderr   r   r    r'   K   s    zinstall.<locals>.<genexpr>c                 s  s    | ]}|t jkV  qd S r"   )r3   r7   )r$   hookr   r   r    r'   Q   r(   )anysys	meta_pathappendr   r   
path_hooksr3   r7   r5   r   r   r   r   r    installJ   s   
rH   )
__future__r   rD   importlib.machineryr   r   r   r)   importlib.utilr   	itertoolsr   pathlibr   r   __annotations__r   r5   r   r3   rH   r   r   r   r    <module>   s    .