
    "dd                    :    d dl mZ d dlmZmZ d Z	 ddZ	 ddZy)    )annotations)PurePosixPathPureWindowsPathc                V    |rt                nE|D ch c]  }|j                          }}|D ch c]  }|j                          }}t                ||z  }|rt        dj	                  |            t         fd|D              xr t         fd|D               S c c}w c c}w )zJInternal function same as :func:`match_path` but does not check arguments.z/conflicting patterns `{}` included and excludedc              3  @   K   | ]  }j                  |        y wNmatch.0ppaths     9/usr/lib/python3/dist-packages/watchdog/utils/patterns.py	<genexpr>z_match_path.<locals>.<genexpr>!   s     8tzz!}8   c              3  @   K   | ]  }j                  |        y wr   r	   r   s     r   r   z_match_path.<locals>.<genexpr>!   s       E

1Er   )r   lowerr   
ValueErrorformatany)r   included_patternsexcluded_patternscase_sensitivepatterncommon_patternss   `     r   _match_pathr      s    T"<MNW]]_NN<MNW]]_NNt$'*;;O=DD_U
 	
 8&788  E0E B >  ONs
   B!B&Nc              #  ~   K   |dgn|}|g n|}| D ]'  }t        |t        |      t        |      |      s$| ) yw)a@  
    Filters from a set of paths based on acceptable patterns and
    ignorable patterns.
    :param pathnames:
        A list of path names that will be filtered based on matching and
        ignored patterns.
    :param included_patterns:
        Allow filenames matching wildcard patterns specified in this list.
        If no pattern list is specified, ["*"] is used as the default pattern,
        which matches all files.
    :param excluded_patterns:
        Ignores filenames matching wildcard patterns specified in this list.
        If no pattern list is specified, no files are ignored.
    :param case_sensitive:
        ``True`` if matching should be case-sensitive; ``False`` otherwise.
    :returns:
        A list of pathnames that matched the allowable patterns and passed
        through the ignored patterns.
    N*r   setpathsr   r   r   includedexcludedr   s          r   filter_pathsr%   &   sN     , *1u7HH&.r4EH tS]CM>JJs   3==c                p    |dgn|}|g n|}| D ]$  }t        |t        |      t        |      |      s$ y y)a  
    Matches from a set of paths based on acceptable patterns and
    ignorable patterns.
    :param pathnames:
        A list of path names that will be filtered based on matching and
        ignored patterns.
    :param included_patterns:
        Allow filenames matching wildcard patterns specified in this list.
        If no pattern list is specified, ["*"] is used as the default pattern,
        which matches all files.
    :param excluded_patterns:
        Ignores filenames matching wildcard patterns specified in this list.
        If no pattern list is specified, no files are ignored.
    :param case_sensitive:
        ``True`` if matching should be case-sensitive; ``False`` otherwise.
    :returns:
        ``True`` if any of the paths matches; ``False`` otherwise.
    r   TFr   r!   s          r   match_any_pathsr'   D   sM    * *1u7HH&.r4EH tS]CM>J     )NNT)
__future__r   pathlibr   r   r   r%   r'    r(   r   <module>r,      s,    # 3( KO> KOr(   