B
    `H	                 @   sh   d Z ddlmZmZmZ eZddlZddlm	Z
 ddlmZ ddlmZ dd	lmZ G d
d deZdS )zIFallback source provider when no other provider matches the content root.    )absolute_importdivisionprint_functionN   )types)TIMEOUT_PATH)to_bytes   )SourceProviderc               @   s(   e Zd ZdZdZedd Zdd ZdS )UnversionedSourcezIFallback source provider when no other provider matches the content root.r   c             C   s   dS )zBReturn True if the given path is a content root for this provider.F )pathr   r   a/home/dcms/DCMS/lib/python3.7/site-packages/ansible_test/_internal/provider/source/unversioned.pyis_content_root   s    z!UnversionedSource.is_content_rootc       
         s   g }d}dddd}dt fi}d xt|D ]\}}}tj||dkrRdx*||d	 D ]}	|	|krd||	 qdW |d	| fd
d|D  |fdd|D  q.W |S )z@Return the list of available content paths under the given path.)z.ideaz.pytest_cache__pycache__zansible.egg-infozansible_base.egg-info)resultscacheoutput)r   )Z_build)testtestszdocs/docsite )z.pycz.pyoz.retry.r   c                s6   g | ].}t j|d   kr|krt j|qS )r	   )osr   splitextjoin).0	file_name)kill_extensions
kill_filesrel_rootr   r   
<listcomp>Q   s    z/UnversionedSource.get_paths.<locals>.<listcomp>c                s2   g | ]*}t jt|rt j |t jj qS r   )r   r   islinkr   r   sep)r   dir_name)r   r   r   r    U   s    )r   r   walkr   relpathgetremoveextend)
selfr   pathsZkill_any_dirZkill_sub_dirZkill_sub_filerootZ	dir_namesZ
file_nameskillr   )r   r   r   r   	get_paths   s&    	zUnversionedSource.get_pathsN)__name__
__module____qualname____doc__sequencestaticmethodr   r-   r   r   r   r   r      s   r   )r1   
__future__r   r   r   type__metaclass__r   r   r   t	constantsr   encodingr   r
   r   r   r   r   r   <module>   s   