
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!DOCTYPE html>
<html>
U
    ¡ê,aA  ã                   @   sÂ   d Z ddlZddlZddlZddlZdddgZddœdd„Zddœd	d„Zd
d„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Ze d¡Ze d¡Zdd„ Zdd„ Zd d!„ Zd"d„ ZdS )#zFilename globbing utility.é    NÚglobÚiglobÚescapeF©Ú	recursivec                C   s   t t| |d�ƒS )ay  Return a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    r   )Úlistr   )Úpathnamer   © r	   ú)/opt/alt/python38/lib64/python3.8/glob.pyr   
   s    c                C   s:   t  d| |¡ t| |dƒ}|r6t| ƒr6t|ƒ}|r6t‚|S )aŒ  Return an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    z	glob.globF)ÚsysÚauditÚ_iglobÚ_isrecursiveÚnextÚAssertionError)r   r   ÚitÚsr	   r	   r
   r      s    c                 c   s   t j | ¡\}}t| ƒsN|r t‚|r8t j | ¡rJ| V  nt j |¡rJ| V  d S |sˆ|rrt|ƒrrt|||ƒE d H  nt	|||ƒE d H  d S || kr¦t|ƒr¦t
||dƒ}n|g}t|ƒrÌ|rÆt|ƒrÆt}qÐt	}nt}|D ]&}||||ƒD ]}t j ||¡V  qäqÔd S )NT)ÚosÚpathÚsplitÚ	has_magicr   ÚlexistsÚisdirr   Ú_glob2Ú_glob1r   Ú_glob0Újoin)r   r   ÚdironlyÚdirnameÚbasenameÚdirsZglob_in_dirÚnamer	   r	   r
   r   )   s2    r   c                 C   s0   t t| |ƒƒ}t|ƒs$dd„ |D ƒ}t ||¡S )Nc                 s   s   | ]}t |ƒs|V  qd S ©N)Ú	_ishidden)Ú.0Úxr	   r	   r
   Ú	<genexpr>T   s      z_glob1.<locals>.<genexpr>)r   Ú_iterdirr#   ÚfnmatchÚfilter)r   Úpatternr   Únamesr	   r	   r
   r   Q   s    r   c                 C   s8   |st j | ¡r4|gS nt j t j | |¡¡r4|gS g S r"   )r   r   r   r   r   )r   r   r   r	   r	   r
   r   W   s    r   c                 C   s   t | |dƒS ©NF)r   ©r   r*   r	   r	   r
   Úglob0d   s    r.   c                 C   s   t | |dƒS r,   )r   r-   r	   r	   r
   Úglob1g   s    r/   c                 c   s.   t |ƒst‚|d d… V  t| |ƒE d H  d S )Nr   )r   r   Ú	_rlistdir)r   r*   r   r	   r	   r
   r   m   s    r   c              
   c   s�   | s"t | tƒrttjdƒ} ntj} zRt | ¡�>}|D ]2}z|rF| ¡ rN|jV  W q4 tk
rd   Y q4X q4W 5 Q R X W n tk
rŠ   Y d S X d S )NÚASCII)Ú
isinstanceÚbytesr   ÚcurdirÚscandirÚis_dirr!   ÚOSError)r   r   r   Úentryr	   r	   r
   r'   t   s    
r'   c                 c   s`   t t| |ƒƒ}|D ]H}t|ƒs|V  | r6tj | |¡n|}t||ƒD ]}tj ||¡V  qDqd S r"   )r   r'   r#   r   r   r   r0   )r   r   r+   r%   r   Úyr	   r	   r
   r0   †   s    r0   z([*?[])s   ([*?[])c                 C   s(   t | tƒrt | ¡}n
t | ¡}|d k	S r"   )r2   r3   Úmagic_check_bytesÚsearchÚmagic_check)r   Úmatchr	   r	   r
   r   “   s    

r   c                 C   s   | d dkS )Nr   )Ú.é.   r	   )r   r	   r	   r
   r#   š   s    r#   c                 C   s   t | tƒr| dkS | dkS d S )Ns   **z**)r2   r3   )r*   r	   r	   r
   r   �   s    
r   c                 C   s<   t j | ¡\}} t| tƒr(t d| ¡} nt d| ¡} ||  S )z#Escape all special characters.
    s   [\1]z[\1])r   r   Ú
splitdriver2   r3   r:   Úsubr<   )r   Zdriver	   r	   r
   r   £   s
    
)Ú__doc__r   Úrer(   r   Ú__all__r   r   r   r   r   r.   r/   r   r'   r0   Úcompiler<   r:   r   r#   r   r   r	   r	   r	   r
   Ú<module>   s*   
(


