%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__/_cf_cloudfiles.cpython-312.pyc

�

�2eP��v�ddlZddlZddlmZddlmZddlmZGd�dejj�Z	y)�N)�log)�util)�BackendExceptionc�F��eZdZdZ�fd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
�xZS)	�CloudFilesBackendz,
    Backend for Rackspace's CloudFiles
    c	�J��t�
|�|�	ddlm}ddlm}ddlm}ddlm}||_i}dtjvrtd��d	tjvrtd
��tjd|d<tjd	|d<d
tjvrtjd
|d<n|j|d<|jj!d�}	|di|��}		j5|�|_y#t$r}tdt|�����d}~wwxYw#t"$re}t%j&d|j(j*�dt-j.|���t$j0j2�Yd}~��d}~wwxYw)Nr)�
Connection)�
ResponseError)�consts)�NoSuchObjectzXCloudfiles backend requires the cloudfiles library available from Rackspace.
Exception: �CLOUDFILES_USERNAMEz0CLOUDFILES_USERNAME environment variablenot set.�CLOUDFILES_APIKEYz/CLOUDFILES_APIKEY environment variable not set.�username�api_key�CLOUDFILES_AUTHURL�authurl�/z2Connection failed, please check your credentials: � �)�super�__init__�
cloudfilesr	�cloudfiles.errorsr
rr�ImportErrorr�str�resp_exc�os�environ�default_authurl�path�lstrip�	Exceptionr�
FatalError�	__class__�__name__r�uexc�	ErrorCode�connection_failed�create_container�	container)�self�
parsed_urlr	r
rr�e�conn_kwargsr*�connr$s          ��C/usr/lib/python3/dist-packages/duplicity/backends/_cf_cloudfiles.pyrzCloudFilesBackend.__init__"s}���
����$�		�-�7�)�6�&��
��� ��
�
�2�"�#X�Y�Y��b�j�j�0�"�#T�U�U�"$�*�*�-B�"C��J��!#���,?�!@��I���2�:�:�-�%'�Z�Z�0D�%E�K�	�"�%+�%;�%;�K�	�"��O�O�*�*�3�/�	�	��,��,�D��.�.�y�9����A�	�"����F�8���
��	��6�	��N�N�D�Q�[�[�EY�EY�DZ�Z[�\`�\e�\e�fg�\h�[i�j��
�
�/�/�
�
��	�s0�D�-D4�	D1�D,�,D1�4	F"�=AF�F"c���t|t�rtjjSt||j
�r*|jdk(rtjjSyy)Ni�)�
isinstancerrr'�backend_not_foundr�status)r+�	operationr-s   r0�_error_codezCloudFilesBackend._error_codeKsO���a��&��=�=�2�2�2�
��4�=�=�
)��x�x�3���}�}�6�6�6��*�c�p�|jj|�}|j|j�y�N)r*�
create_object�load_from_filename�name)r+�source_path�remote_filename�sobjects    r0�_putzCloudFilesBackend._putRs*���.�.�.�.��?���"�"�;�#3�#3�4r7c���|jj|�}t|jd�5}|j	�D]}|j|��	ddd�y#1swYyxYw)N�wb)r*r:�openr<�stream�write)r+r>�
local_pathr?�f�chunks      r0�_getzCloudFilesBackend._getVs\���.�.�.�.��?��
�*�/�/�4�
(�	�A� ���)�
�������
�	�	�	�s�'A#�#A,c��|jj�}|}t|�dk(r3|jj|d��}||z
}t|�dk(r�3|S)Ni'���)�marker)r*�list_objects�len)r+�objs�keyss   r0�_listzCloudFilesBackend._list\s`���~�~�*�*�,�����$�i�5� ��>�>�.�.�d�2�h�.�?�D��D�L�D��$�i�5� ��r7c�:�|jj|�yr9)r*�
delete_object)r+�filenames  r0�_deletezCloudFilesBackend._deletefs�����$�$�X�.r7c�T�|jj|�}d|jiS)N�size)r*�
get_objectrW)r+rTr?s   r0�_queryzCloudFilesBackend._queryis%���.�.�+�+�H�5������%�%r7)r%�
__module__�__qualname__�__doc__rr6r@rIrQrUrY�
__classcell__)r$s@r0rrs,����':�R7�5���/�&r7r)
r�duplicity.backend�	duplicityrr�duplicity.errorsr�backend�Backendrrr7r0�<module>rcs0��*
����-�N&�	�)�)�1�1�N&r7

Zerion Mini Shell 1.0