
    g
                        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y)z'Functions related to discovering paths.    )annotationsN)Callable)	Generator)Sequence)utilsc             #    K    ||       ryt         j                  j                  |       rt        j                  |       D ]  \  }}}t	        |      D ]<  }t         j                  j                  ||      } ||      s,|j                  |       > |D ]/  }t         j                  j                  ||      } ||      r,| 1  y|  yw)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)arg	predicaterootsub_directoriesfiles	directoryjoinedfilenames           X/var/www/html/brdwt/brdwt/brdwtenv/lib/python3.12/site-packages/flake8/discover_files.py_filenames_fromr      s     " ~	ww}}S,.GGCL 	!(D/5 #?3 6	dI6V$#**956
 " !dH5 ( L!	! 	s   A;C>A C?Cc                :    | sdg} dfdfd| D        S )z<Expand out ``paths`` from commandline to the lintable files..c                X    | dk(  rdk(  ry} t        j                  | dt              S )N-stdinFz'"%(path)s" has %(whether)sbeen excluded)patternslog_messagelogger)r   matches_filenameLOG)r   excludestdin_display_names    r   is_excludedz!expand_paths.<locals>.is_excluded?   s9    #:!W,$C%%A	
 	
    c              3     K   | ]8  }t        |       D ]&  }|dk(  s||k(  st        j                  |      r| ( : yw))r   r   N)r   r   fnmatch).0r
   r   filename_patternsr&   s      r   	<genexpr>zexpand_paths.<locals>.<genexpr>M   sU      'D  Ox}}X'89 	s   >A)r   strreturnbool )pathsr%   r+   r$   r&   s    ```@r   expand_pathsr2   4   s&     
 r'   )r   r-   r   zCallable[[str], bool]r.   Generator[str, None, None])
r1   Sequence[str]r%   r-   r+   r4   r$   r4   r.   r3   )__doc__
__future__r   loggingos.pathr	   typingr   r   r   flake8r   	getLogger__name__r#   r   r2   r0   r'   r   <module>r=      s    - "      g!"	" %"  	"J%% % %	%
 %  %r'   