
    yIf
                        d Z ddlmZ ddl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  ej        e          ZddZddZdS )z'Functions related to discovering paths.    )annotationsN)Callable)	Generator)Sequence)utilsargstr	predicateCallable[[str], bool]returnGenerator[str, None, None]c             #    K    ||           rdS t           j                            |           rt          j        |           D ]\  }}}t	          |          D ]B}t           j                            ||          } ||          r|                    |           C|D ]1}t           j                            ||          } ||          s|V  2dS | V  dS )ay  Generate filenames from an argument.

    :param arg:
        Parameter from the command-line.
    :param predicate:
        Predicate to use to filter out filenames. If the predicate
        returns ``True`` we will exclude the filename, otherwise we
        will yield it. By default, we include every filename
        generated.
    :returns:
        Generator of paths
    N)ospathisdirwalktuplejoinremove)r   r
   rootsub_directoriesfiles	directoryjoinedfilenames           I/var/www/piapp/venv/lib/python3.11/site-packages/flake8/discover_files.py_filenames_fromr      s     " y~~ 	w}}S ,.GCLL 	! 	!(D/5 #?33 6 6	dI669V$$ 6#**9555! ! !dH55 y(( ! LLL!	! 	! 					    pathsSequence[str]stdin_display_namefilename_patternsexcludec                @    | sdg} dfdfd| D             S )	z<Expand out ``paths`` from commandline to the lintable files..r   r	   r   boolc                ^    | dk    r
dk    rdS } t          j        | dt                    S )N-stdinFz'"%(path)s" has %(whether)sbeen excluded)patternslog_messagelogger)r   matches_filenameLOG)r   r#   r!   s    r   is_excludedz!expand_paths.<locals>.is_excluded?   sG    #::!W,,u$C%A	
 
 
 	
r   c              3     K   | ];}t          |           D ]'}|dk    s||k    st          j        |          #|V  (<dS ))r
   r(   N)r   r   fnmatch).0r   r   r"   r/   s      r   	<genexpr>zexpand_paths.<locals>.<genexpr>M   s~        'DDD   OOx}X'899   	   r   )r   r	   r   r&    )r   r!   r"   r#   r/   s    ```@r   expand_pathsr5   4   sj      
 
 
 
 
 
 
       r   )r   r	   r
   r   r   r   )
r   r    r!   r	   r"   r    r#   r    r   r   )__doc__
__future__r   loggingos.pathr   typingr   r   r   flake8r   	getLogger__name__r.   r   r5   r4   r   r   <module>r>      s    - - " " " " " "                          g!!" " " "J% % % % % %r   