https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/duplicity/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/duplicity/__pycache__/globmatch.cpython-310.pyc
o

�~�_9�@sjddlZddlmZddlmZddlmZGdd�de�ZGdd�de�Zd	d
�Zddd
�Z	dd�Z
dS)�N)�map)�range)�strc@�eZdZdZdS)�
GlobbingErrorz3Something has gone wrong when parsing a glob stringN��__name__�
__module__�__qualname__�__doc__�rr�5/usr/lib/python3/dist-packages/duplicity/globmatch.pyr!�rc@r)�FilePrefixErrorz?Signals that a specified file doesn't start with correct prefixNrrrrr
r&rrcsb|�d��d�dd�vrtd|���fdd�tt���D�}|ddkr*d|d<ttt|��S)	z9Return list of regexps equivalent to prefixes of glob_str�/�����z*Consecutive '/'s found in globbing string cs"g|]
}d��d|d���qS)rNr)�join)�.0�i��
glob_partsrr
�
<listcomp>4s"z+_glob_get_prefix_regexs.<locals>.<listcomp>r)�splitrr�len�listr�
glob_to_regex)�glob_str�prefixesrrr
�_glob_get_prefix_regexs+s
�r Fcs�t�t�sJ�d��dkrd�n�ddkrd��dd��d�|r%tj��fdd	�}|d
t�����r=|dt������d�dkrO�d��d�d
��|dd�t�����������fdd�}|S)aAReturn a function test_fn(path) which
    tests whether path matches glob, as per the Unix shell rules, taking as
    arguments a path, a glob string and include (0 indicating that the glob
    string is an exclude glob and 1 indicating that it is an include glob,
    returning:
    0 - if the file should be excluded
    1 - if the file should be included
    2 - if the folder should be scanned for any included/excluded files
    None - if the selection function has nothing to say about the file

    Note: including a folder implicitly includes everything within it.
    Frz/**rTNrcst�|tj�B�S)N)�re�compile�S)�r)�flagsrr
�<lambda>Xsz%select_fn_from_glob.<locals>.<lambda>z^%s($|/)z^%s($)�**�z^(%s)$�|cs~|jddkr|jdksJd|jd�����|j�r1�s!�S��|j�r/|��r-�SdS�S�dkr=��|j�r=dSdS)Nrrzppath.name should never end in '/' during normal operation for normal paths (except '/' alone)
path.name here is z
 and glob is rr()�uc_name�match�isdir)�path)�glob_comp_re�glob_comp_re_exact�glob_ends_w_slashr�include�scan_comp_rerr
�test_fnus(����z$select_fn_from_glob.<locals>.test_fn)�
isinstancerr!�
IGNORECASEr�findrr )rr1�ignore_case�re_compr3r)r%r.r/r0rr1r2r
�select_fn_from_glob;s*

�r9cCstt|t�sJ�dt|�d}}}||kr�|||||d�}}|d}|dkr3|d}|d}n�|dkr<|d}nx|d	krE|d
}no|dkr�|}||krY||dvrY|d}||krg||d
krg|d}||kr||d
kr|d}||kr||d
ksq||kr�|d}n,|||��dd�}|d}|ddvr�d|dd�}|d|d
}n|t�|�}||ks|S)aEReturned regular expression equivalent to shell glob pat

    Currently only the ?, *, [], and ** expressions are supported.
    Ranges like [a-z] are currently unsupported.  There is no
    way to quote these special characters.

    This function taken with minor modifications from efnmatch.py
    by Donovan Baarda.

    rrr(rr'z.*�*z[^/]*�?z[^/]�[z!^�]z\[�\z\\�^N)r4rr�replacer!�escape)�patr�n�res�c�s�j�stuffrrr
r�s>



�
�r)F)r!�builtinsrrr�	Exceptionrrr r9rrrrr
�<module>s
[

https://t.me/RX1948 - 2025