%PDF- %PDF-
Mini Shell

Mini Shell

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

�

�2e�>����ddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlmZddlm
Z
Gd�dejj�Zejj#de�y)	�N)�config)�log)�util)�BackendExceptionc��eZdZdZgZiZegd��ZdZeddg�Z	dZ
eddg�ZdZdZ
ed	��Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zy)�MultiBackendz�Store files across multiple remote stores. URL is a path to a local file
    containing URLs/other config defining the remote store)�mode�onfail�subpath�stripe�mirror�continue�abort�rc�n�tjj|j��}t	|j
�dk(r
t
�S	tjj|j
d��}t
�}t|j��D]�\}}t	|�dk7rGtjtd�|j
|fztj�td��|t j"vrGtjtd	�|j
|fztj�td��|d||<��|S#t$rL}tjtd�|j
|fztj�td��d}~wwxYw)
NrT)�strict_parsingz2MultiBackend: Could not parse query string %s: %s zCould not parse query string�zAMultiBackend: Invalid query string %s: more than one value for %szInvalid query stringz;MultiBackend: Invalid query string %s: unknown parameter %s)�urllib�parse�urlparse�geturl�len�query�dict�parse_qs�
ValueErrorr�Log�_�ERRORr�list�itemsr�#_MultiBackend__knownQueryParameters)�
parsed_url�reparsed_url�queryMultiDict�e�	queryDict�name�	valueLists       �A/usr/lib/python3/dist-packages/duplicity/backends/multibackend.py�get_query_paramszMultiBackend.get_query_paramsZs����|�|�,�,�Z�->�->�-@�A���|�!�!�"�a�'��6�M�	C�#�\�\�2�2�<�3E�3E�VZ�2�[�N��F�	� $�N�$8�$8�$:�;�	+�O�D�)��9�~��"�����Y�Z�^j�^p�^p�rv�]w�w��I�I��'�'=�>�>��<�>�>�>�����S�T�Xd�Xj�Xj�lp�Wq�q��I�I��'�'=�>�>�'��l�I�d�O�	+����1�	C��G�G��F�G�<�K]�K]�_`�Ja�a��	�	�
�#�#A�B�B��	C�s�+E�	F4�(AF/�/F4c��tjjj||�tj|�}d|vr
|d|_d|vr
|d|_|jtjvrGtjtd�d|jfztj�td��|jtjvrGtjtd�d|jfztj�td��d|vr
|d|_	t!|j"�5}t%j&|�}ddd�D�]t}|d
|jz}tjtd�|ztj,�d|vr[|dD]S}tjtd
�|d|dfztj,�|dt.j0|d<�Utjj3|�}	|j4j7|	�d|vs��|jdk(rtd��|dD]o}
tjtd�|
ztj,�|
|j8vr|j8|
j7|	��`|	g|j8|
<�q��wy#1swY���xYw#t($r�}tjtd�|j+�ztj�tjtd�|j"|fztj�td	��d}~wwxYw)Nr	r
z&MultiBackend: illegal value for %s: %sz MultiBackend: invalid mode valuez"MultiBackend: invalid onfail valuerzMultiBackend: Url %sz0MultiBackend: Could not load config file %s: %s zCould not load config file�urlzMultiBackend: use store %s�envzMultiBackend: set env %s = %sr(�value�prefixesrz=Multibackend: stripe mode not supported with prefix affinity.z-Multibackend: register affinity for prefix %s)�	duplicity�backend�Backend�__init__rr+�_MultiBackend__mode�_MultiBackend__onfail_mode�_MultiBackend__mode_allowedSetrrrrr�%_MultiBackend__onfail_mode_allowedSet�_MultiBackend__subpath�open�path�json�load�IOError�
strip_auth�INFO�os�environ�get_backend�_MultiBackend__stores�append�_MultiBackend__affinities)�selfr#�queryParams�f�configsr&rr-r.�store�prefixs           r*r4zMultiBackend.__init__|s�����!�!�*�*�4��<�@#�3�3�J�?���[� �%�f�-�D�K��{�"�!,�X�!6�D���;�;�l�<�<�<��G�G��:�;�v�t�{�{�>S�S��	�	�
�#�#E�F�F����\�%J�%J�J��G�G��:�;�x��I[�I[�>\�\��	�	�
�#�#G�H�H���#�(��3�D�N�
	A��j�o�o�&�
'�!��)�)�A�,��
'��	<�F���-�$�.�.�0�C��G�G�A�2�3�c�9�3�8�8�D����!�%�=�;�C��G�G��9�:�c�&�k�3�w�<�=X�X�����/2�'�l�B�J�J�s�6�{�+�;��%�%�1�1�#�6�E��M�M� � ��'��V�#��;�;�(�*�*�+j�k�k�$�Z�0�<�F��G�G��I�J�V�S�������!2�!2�2��)�)�&�1�8�8��?�5:�G��)�)�&�1�<�%	<�
'�
'���	A��G�G�A�,�-��1F�1F�1H�I�3�9�9�U��G�G��D�E����Z[�H\�\��	�	�
�#�#?�@�@��	A�s1�1K,�K�K,�K)�$K,�,	M?�5BM:�:M?c�V�|jr�t|jj��D�cgc])}tj|�j|�s�(|��+}}|D��chc]}|j|D]}|���}}}|rt|�S|jScc}wcc}}w)N)rFr �keysrA�fsdecode�
startswithrD)rG�filename�k�matching_prefixesrLrK�matching_storess       r*�_eligible_storeszMultiBackend._eligible_stores�s������,0��1B�1B�1G�1G�1I�,J� r�q�b�k�k�Zb�Nc�Nn�Nn�op�Nq�� r�� r�3D�l��RV�Rc�Rc�dj�Rk�l��u�l�u�l�O�l���O�,�,��}�}���!s��ls�)B �B �'B%c��d}|j|�}|jdk(rd|_|j}	||j}	|jdz}|t|�dz
kDrd}t	j
t
d�|j|jjj�fztj�|j||�d}||_|dk(ry|jdk(ry	��#t$�r}t	j
t
d�|j|jjj�|fztj�||_|jd	k(r;t	j
t
d
�|ztj�t!d��|j|k(r=|s;t	j
t
d�|ztj�t!d��Yd}~��d}~wwxYw)
NFr
rTrz+MultiBackend: _put: write to store #%s (%s)rzGMultiBackend: failed to write to store #%s (%s), try #%s, Exception: %srz3MultiBackend: failed to write %s. Aborting process.zfailed to writezMMultiBackend: failed to write %s. Tried all backing stores and none succeeded)rUr5�_MultiBackend__write_cursorrrrrr2r#r?�DEBUG�put�	Exceptionr@r6rr)	rG�source_path�remote_filename�passed�stores�firstrK�nextr&s	         r*�_putzMultiBackend._put�s������&�&��7���;�;�(�"�"#�D���#�#����4�.�.�/�E�.
>��*�*�Q�.���#�f�+��/�)��D�����C�D��*�*�E�M�M�,D�,D�,O�,O�,Q�R�S��I�I��
�	�	�+��7���&*��#��1�9���;�;�(�*��+�%��(�
>�����_�`��+�+��
�
�0�0�;�;�=���	���H�H�	�'+��#��%�%��0��G�G��O�P�S^�^��	�	��+�+<�=�=��'�'�5�0�&��G�G��i�j�%�&��	�	��
+�+<�=�=���9
>�s �B C:�(C:�:
H�C=H�Hc��|j|�}|D]}|j�}||vr|j||�ytjtd�|||jjj�fztj���tjtd�|ztj�td��)Nz,MultiBackend: failed to get %s to %s from %szKMultiBackend: failed to get %s. Tried all backing stores and none succeededz
failed to get)rUr �getrrrr2r#r?r@rr)rGr\�
local_pathr^�s�flists      r*�_getzMultiBackend._get,s����&�&��7���		�A��F�F�H�E��%�'����o�z�2���G�G��@�A�"�J��	�	�0D�0D�0O�0O�0Q�R�S����
�		�	���
�[�\�_n�n��I�I�	
���/�/�c�D�g}|jD�]5}dgftjd<|j�}t	j
t
d�|jjj�t|�fz�t|�dk(r�tjjr�t	jt
d|jjj��dtjtjj�����dtj_|j!|���8t|D��chc]}|D]}|���
c}}�}t	j"t
d�|ztj$�|Scc}}w)NFr zMultiBackend: %s: %d filesrzException during list of z: zMultiBackend: combined list: %s)rDr�are_errors_fatalr r�Noticerr2r#r?rr1�_last_exception�Warnr�uexcrErrX)rG�listsre�l�sublist�item�results       r*�_listzMultiBackend._listEsA�������	�A�/4�b�k�F�#�#�F�+�����A��J�J�q�5�6�!�)�)�:N�:N�:Y�:Y�:[�]`�ab�]c�9d�d�e��1�v��{�y�0�0�@�@�����3�A�I�I�4H�4H�4S�4S�4U�3V�VX��9�9�Y�%6�%6�%F�%F�G�H�J���59�	�!�!�1��L�L��O�	��5�E��W�E�T�t�E�t�E�F������3�4�v�=�s�y�y�I��
��Fs�F
c��d}|j|�}|D]z}|j�}||vs�t|jd�r|j	|g�n't|jd�r|j|�d}|jdk(s�zy|s1tjtd�|ztj�yy�NF�_delete_list�_deleteTrzNMultiBackend: failed to delete %s. Tried all backing stores and none succeeded)rUr �hasattrr2�_do_delete_list�
_do_deleter5rrrr)rGrQr]r^rerfs      r*rxzMultiBackend._deleteYs������&�&�x�0���	�A��F�F�H�E��5� ��1�9�9�n�5��%�%�$���
�Q�Y�Y�	�2��L�L��*����;�;�(�*��	���G�G��b�c�fn�n��	�	�
�rhc��d}|j}|D]�}|j�}|D�cgc]	}||vs�|��}}t|jd�r|j	|�n.t|jd�r|D]}|j|��d}|jdk(s��y|s1tjtd�|ztj�yycc}wrv)rDr ryr2rzr{r5rrrr)	rG�	filenamesr]r^rerfrI�cleanedrQs	         r*rwzMultiBackend._delete_listzs����������	�A��F�F�H�E�"+�:�Q�q�E�z�q�:�G�:��q�y�y�.�1��!�!�'�*�����I�.� '�+�H��L�L��*�+��F��{�{�h�&��	���G�G��b�c�fo�o��	�	�
���;s
�	C�Cc��|jD]4}t|jd�s�|jj|��6y)N�pre_process_download)rDryr2r�)rGrQrKs   r*r�z!MultiBackend.pre_process_download�s6���]�]�	=�E��u�}�}�&<�=��
�
�2�2�8�<�	=rhc��t|�}|jD]b}t|jd�s�|j	|j��}t
|�dkDs�H|jj|��dy)N�pre_process_download_batchr)�setrDryr2�intersectionr rr�)rGr}�	set_filesrK�store_files_to_downloads     r*r�z'MultiBackend.pre_process_download_batch�sg���	�N�	��]�]�	V�E��u�}�}�&B�C�*3�*@�*@�����*N�'��.�/�!�3��M�M�<�<�=T�U�		VrhN)�__name__�
__module__�__qualname__�__doc__rDrF�	frozensetr"r5r7r6r8r9rW�staticmethodr+r4rUrargrtrxrwr�r��rhr*rr(s���>��H��L�'�	
����F�!���	
����M�(���	
� ���I��N�����B`<�N	�<>�|0�2�(�B�<=�
Vrhr�multi)r<rA�os.path�urllib.errorr�urllib.parse�urllib.request�duplicity.backendr1rrr�duplicity.errorsrr2r3r�register_backendr�rhr*�<module>r�s]��4�	���������-�{V�9�$�$�,�,�{V�|
���"�"�7�L�9rh

Zerion Mini Shell 1.0