%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/duplicity/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/duplicity/__pycache__/globmatch.cpython-312.pyc

�

�2eq��L�ddlZGd�de�ZGd�de�Zd�Zd	d�Zd�Zy)
�Nc��eZdZdZy)�
GlobbingErrorz3Something has gone wrong when parsing a glob stringN��__name__�
__module__�__qualname__�__doc__���5/usr/lib/python3/dist-packages/duplicity/globmatch.pyrrs��=�rrc��eZdZdZy)�FilePrefixErrorz?Signals that a specified file doesn't start with correct prefixNrr
rrrr#s��I�rrc	��|jd�}d|ddvrtd|����tt|��D�cgc]}dj	|d|dz���}}|ddk(rd|d<tt
t|��Scc}w)z9Return list of regexps equivalent to prefixes of glob_str�/�����z*Consecutive '/'s found in globbing string Nr)�splitr�range�len�join�list�map�
glob_to_regex)�glob_str�
glob_parts�i�prefixess    r�_glob_get_prefix_regexsr)s�������$�J�	�Z��"�
���H��
�S�T�T�7<�S��_�7M�N�!�����G�a�!�e�,�-�N�H�N���{�b��������M�8�,�-�-��	Os�Bc��������	�t�t�sJ�d��dk(rd�n�ddk(rd��dd�d�|rtj��fd�}|d	t	���d
����r|d	t	���d����jd�dk7r�d�jd�d
z�|ddj
t����d���	������	fd�}|S)a7Return 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


    The basic idea is to turn glob_str into a regular expression,
    and just use the normal regular expression.  There is a
    complication because the selection function should return '2'
    (scan) for directories which may contain a file which matches
    the glob_str.  So we break up the glob string into parts, and
    any file which matches an initial sequence of glob parts gets
    scanned.

    Thanks to Donovan Baarda who provided some code which did some
    things similar to this.

    Note: including a folder implicitly includes everything within it.
    Frz/**rTNrc�R��tj|tj�z�S)N)�re�compile�S)�r�flagss �r�<lambda>z%select_fn_from_glob.<locals>.<lambda>bs����
�
�1�b�d�d�U�l�3�r�^z($|/)z($)�**�z^(�|z)$c�\��|jddk(r)|jdk(sJd|jzdz�z���j|j�r4�s�S�j|j�r|j�r�Sy�S�dk(r�j|j�ryy)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_res ������r�test_fnz$select_fn_from_glob.<locals>.test_fn~s�����<�<��#�s�*�d�l�l�c�.A�	
�
!�#'�<�<�
0�2A�
B�DL�
M�	
�A����d�l�l�+�$���&�+�+�D�L�L�9��z�z�|�&�� $�#�N�
��\�l�0�0����>��r)�
isinstance�strr"�
IGNORECASEr�findrr)
rr4�ignore_case�re_compr6r&r1r2r3r5s
``   @@@@@r�select_fn_from_globr=8s����4�h��$�$�$����3����	�"���	� ���C�R�=��
�E���
�
��3�G��Q�}�X�6�7�u�=�>�L��%�q��x�)@�(A��%E�F���}�}�T��b� ��5�h�m�m�D�1�A�5�6���R����)@��)J� K�L�B�O�P�L���>�Nrc��t|t�sJ�dt|�d}}}||kr�|||||dz}}|dz}|dk(r|�d�}|dz}n�|dk(r|�d�}n�|d	k(r|�d
�}n�|dk(r�|}||kr||dvr|dz}||kr
||d
k(r|dz}||kr||d
k7r|dz}||kr	||d
k7r�||k\r|�d�}nJ|||jdd�}|dz}|ddvrd|dd��}|�d|�d
�}n|t	j
|�z}||kr��|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\\r(N)r7r8r�replacer"�escape)�patr�n�res�c�s�j�stuffs        rrr�s~���c�3�����3�s�8�R�#�q�A�
�a�%��1�v�s�1�q�1�u�~�1��
��E����9��E��*�C��A��A�
�#�X��E��-�C�
�#�X��E��,�C�
�#�X��A��1�u��Q��4����E���1�u��Q��3����E���a�%�C��F�c�M���E���a�%�C��F�c�M��A�v���S�k���A�a��(�(��v�6����E����8�t�#���a�b�	�{�O�E���Q�u�g�Q�'����	�	�!��$�C�9�a�%�:�Jr)F)r"�	Exceptionrrrr=rr
rr�<module>rNs3��4
�	�I�	�	�m�	�.�e�P-r

Zerion Mini Shell 1.0