3
ø½6b:	  ã               @   s4   d dl Zd dlZG dd„ dƒZdZeeeƒjƒ  dS )é    Nc               @   s\   e Zd ZdZf dfdd„Zedd„ ƒZdd„ Zd	d
„ Zdd„ Z	dd„ Z
ddd„Zdd„ ZdS )ÚVendorImporterz„
    A PEP 302 meta path importer for finding optionally-vendored
    or otherwise naturally-installed packages from root_name.
    Nc             C   s&   || _ t|ƒ| _|p|jddƒ| _d S )NZexternZ_vendor)Ú	root_nameÚsetÚvendored_namesÚreplaceÚ
vendor_pkg)Úselfr   r   r   © r	   ú\/var/www/html/sandeepIITI/myenv/lib/python3.6/site-packages/pkg_resources/extern/__init__.pyÚ__init__   s    
zVendorImporter.__init__c             c   s   | j d V  dV  dS )zL
        Search first the vendor package then as a natural package.
        Ú.Ú N)r   )r   r	   r	   r
   Úsearch_path   s    zVendorImporter.search_pathc             C   s.   |j | jd ƒ\}}}| o,tt|j| jƒƒS )z,Figure out if the target module is vendored.r   )Ú	partitionr   ÚanyÚmapÚ
startswithr   )r   ÚfullnameÚrootÚbaseÚtargetr	   r	   r
   Ú_module_matches_namespace   s    z(VendorImporter._module_matches_namespacec             C   sz   |j | jd ƒ\}}}x^| jD ]B}y(|| }t|ƒ tj| }|tj|< |S  tk
r^   Y qX qW tdjf tƒ Žƒ‚dS )zK
        Iterate over the search path to locate and load fullname.
        r   z•The '{target}' package is required; normally this is bundled with this package so if you get this warning, consult the packager of your distribution.N)	r   r   r   Ú
__import__ÚsysÚmodulesÚImportErrorÚformatÚlocals)r   r   r   r   r   ÚprefixZextantÚmodr	   r	   r
   Úload_module   s    


zVendorImporter.load_modulec             C   s   | j |jƒS )N)r    Úname)r   Úspecr	   r	   r
   Úcreate_module3   s    zVendorImporter.create_modulec             C   s   d S )Nr	   )r   Úmoduler	   r	   r
   Úexec_module6   s    zVendorImporter.exec_modulec             C   s   | j |ƒrtjj|| ƒS dS )z(Return a module spec for vendored names.N)r   Ú	importlibÚutilÚspec_from_loader)r   r   Úpathr   r	   r	   r
   Ú	find_spec9   s    zVendorImporter.find_specc             C   s   | t jkrt jj| ƒ dS )zR
        Install this importer into sys.meta_path if not already present.
        N)r   Ú	meta_pathÚappend)r   r	   r	   r
   Úinstall@   s    
zVendorImporter.install)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Úpropertyr   r   r    r#   r%   r*   r-   r	   r	   r	   r
   r      s   
r   Ú	packagingÚ	pyparsingÚappdirs)r3   r4   r5   )Úimportlib.utilr&   r   r   Únamesr.   r-   r	   r	   r	   r
   Ú<module>   s   C