Your IP : 216.73.216.213


Current Path : /opt/alt/python37/lib/python3.7/site-packages/prospector/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/prospector/__pycache__/finder.cpython-37.pyc

B

a�\��@sJddlZddlmZGdd�de�ZGdd�de�Zdd�Zdd
d�ZdS)
�N)�
is_virtualenvc@szeZdZdZdd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	d dd�Z
d!dd�Zd"dd�Zdd�Z
d#dd�ZdS)$�SingleFilesz�
    When prospector is run in 'single file mode' - that is,
    the argument is a python module rather than a directory -
    then we'll use this object instead of the FoundFiles to
    give all the functionality needed to check a single file.
    cCs||_||_dS)N)�files�rootpath)�selfrr�r�B/opt/alt/python37/lib/python3.7/site-packages/prospector/finder.py�__init__szSingleFiles.__init__TcCs.|r$tj�|�}|ttjj|j�kS||jkS)N)�os�path�abspath�mapr)r�	checkpathrrrr�_checkszSingleFiles._checkFcCs|�||�S)N)r)r�filepathr�even_if_ignoredrrr�check_moduleszSingleFiles.check_modulecCs|�||�S)N)r)rrrrrrr�
check_package!szSingleFiles.check_packagecCs|�||�S)N)r)rrrrrrr�
check_file$szSingleFiles.check_fileccs*x$|jD]}|rtj�|�n|VqWdS)N)rr
rr)rr�include_ignoredrrrr�iter_file_paths'szSingleFiles.iter_file_pathsccs*x$|jD]}|rtj�|�n|VqWdS)N)rr
rr)rrrrrrr�iter_package_paths+szSingleFiles.iter_package_pathsccs6x0|jD]&}tj�|�}|r(tj�|�n|VqWdS)N)rr
r�dirnamer)rrrrrrr�iter_directory_paths/sz SingleFiles.iter_directory_pathsccs*x$|jD]}|rtj�|�n|VqWdS)N)rr
rr)rrrrrrr�iter_module_paths4szSingleFiles.iter_module_pathscCstj�tj�|j|��S)N)r
rr�joinr)rrrrr�to_absolute_path8szSingleFiles.to_absolute_pathcCs:ttttjj|j���}|r.tttjj|��}|jg|S)N)	�list�setr
r
rrrrr)r�absolute_paths�pathsrrr�get_minimal_syspath;szSingleFiles.get_minimal_syspathN)T)TF)TF)TF)TF)TF)TF)TF)T)�__name__�
__module__�__qualname__�__doc__r	rrrrrrrrrr!rrrrrs







rc@s�eZdZdd�Zddd�Zddd�Zdd	d
�Zddd�Zd d
d�Zd!dd�Z	d"dd�Z
d#dd�Zd$dd�Zdd�Z
d%dd�ZdS)&�
FoundFilescCs(||_||_||_||_||_||_dS)N)r�_files�_modules�	_packages�_directoriesZ_ignores)rrr�modules�packages�directories�ignoresrrrr	CszFoundFiles.__init__TFcCsD|rtj�||j�n|}x&|D]\}}||kr|r8|s8PdSqWdS)NTF)r
r�relpathr)rr�pathlistrrrr�ignoredrrrrKszFoundFiles._checkcCs|�||j||�S)N)rr()rrrrrrrrTszFoundFiles.check_modulecCs|�||j||�S)N)rr))rrrrrrrrWszFoundFiles.check_packagecCs|�||j||�S)N)rr')rrrrrrrrZszFoundFiles.check_fileccs4x.|D]&\}}|r|sq|r&|�|�}|VqWdS)N)r)rr0rrrr1rrr�_iter_paths]s
zFoundFiles._iter_pathscCs|�|j||�S)N)r2r')rrrrrrreszFoundFiles.iter_file_pathscCs|�|j||�S)N)r2r))rrrrrrrhszFoundFiles.iter_package_pathscCs|�|j||�S)N)r2r*)rrrrrrrkszFoundFiles.iter_directory_pathscCs|�|j||�S)N)r2r()rrrrrrrnszFoundFiles.iter_module_pathscCstj�tj�|j|��S)N)r
rrrr)rrrrrrqszFoundFiles.to_absolute_pathcs�t�}dd��jD�}x>t|td�D].}tj�|�d}||kr$||kr$|�|�q$Wg}dd��jD�}x*|D]"}tj�	|�}	|	|krp|�
|	�qpWtt|�|B�jhBtd�}
|rȇfdd�|
D�}
|
S)z�
        Provide a list of directories that, when added to sys.path, would enable
        any of the discovered python modules to be found
        cSsg|]}|ds|d�qS)�rr)�.0�prrr�
<listcomp>{sz2FoundFiles.get_minimal_syspath.<locals>.<listcomp>)�keyrcSsg|]}|ds|d�qS)r3rr)r4�mrrrr6�scs&g|]}tj��j|��tjj��qSr)r
rrr�rstrip�sep)r4r5)rrrr6�s)rr)�sorted�lenr
r�split�addr(r�appendr)rrZpackage_listr,�package�parentZmodule_listr+�modulerZ	full_listr)rrr!ts 
zFoundFiles.get_minimal_syspathN)TF)TF)TF)TF)TF)TF)TF)TF)TF)T)r"r#r$r	rrrrr2rrrrrr!rrrrr&Bs
	







r&c	s~ggggf\}}}}�xZt�|�D�]J}tj�||�}ytj�||��Wntk
r^w"YnX|�d�rxtj�|�rxq"tj�|�r�q"t	�fdd�|D��}	tj�|��rFt
|�s"d|kr�q"|��|	f�tj�|d�}
tj�|
�r�tj�
|
�r�|��|	f�t|tj�||�|�}||d7}||d7}||d7}||d	7}q"|�d
��r`|��|	f�|��|	f�q"W||||fS)N�.csg|]}|����qSr)�search)r4r8)r/rrr6�sz_find_paths.<locals>.<listcomp>z.toxz__init__.pyrr3��z.py)r
�listdirrrr/�
ValueError�
startswith�isdir�islink�anyrr?�exists�isfile�_find_paths�endswith)�ignoreZcurpathrrr+r,r-�filename�fullpathr1ZinitpyZrecurser)r/rrO�s8rO�cCsT|rt||pt���St|�dks&t�t||d|�\}}}}t||||||�SdS)a+
    Returns a FoundFiles class containing a list of files, packages, directories,
    where files are simply all python (.py) files, packages are directories
    containing an `__init__.py` file, and directories is a list of all directories.
    All paths are relative to the dirpath argument.
    r3rN)rr
�getcwdr<�AssertionErrorrOr&)r.r Zexplicit_file_modeZworkdirrr+r-r,rrr�find_python�s
rW)rT)r
Zprospector.pathutilsr�objectrr&rOrWrrrr�<module>s
;M1