
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!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   s2   t  d| |¡ t| |dƒ}|r.t| ƒr.t|ƒ}|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)r   r   ÚitÚsr	   r	   r
   r      s
    c                 c   sø   t j | ¡\}}t| ƒsF|r0t j | ¡rB| V  nt j |¡rB| V  d S |s€|rjt|ƒrjt|||ƒ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_magicÚlexistsÚisdirr   Ú_glob2Ú_glob1r   Ú_glob0Újoin)r   r   ÚdironlyÚdirnameÚbasenameÚdirsZglob_in_dirÚnamer	   r	   r
   r   )   s0    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"   |d d… V  t | |ƒE d H  d S )Nr   )Ú	_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   r/   )r   r   r*   r$   r   Úyr	   r	   r
   r/   †   s    r/   z([*?[])s   ([*?[])c                 C   s(   t | tƒrt | ¡}n
t | ¡}|d k	S r!   )r1   r2   Ú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**)r1   r2   )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   Ú
splitdriver1   r2   r9   Úsubr;   )r   Zdriver	   r	   r
   r   £   s
    
)Ú__doc__r   Úrer'   r   Ú__all__r   r   r   r   r   r-   r.   r   r&   r/   Úcompiler;   r9   r   r"   r   r   r	   r	   r	   r
   Ú<module>   s*   
(


