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

�

�2ey����ddlZddlZddlZddlmZddlmZd�Zd�Zd�Z	d�Z
d�ZGd	�d
ejj�Zejjde�y)�N)�log)�BackendExceptionc�P�d}|jD]}|jdk(s�|}�|S)N�Jotta)�devices�name)�jfs�jottadev�js   �F/usr/lib/python3/dist-packages/duplicity/backends/jottacloudbackend.py�get_jotta_devicer
#s2���H�
�[�[����6�6�W���H���O�c�:�t|�}|jd}|S)N�Archive)r
�mountPoints)r	r
�root_dirs   r�get_root_dirr+s!����$�H��#�#�I�.�H��Orc�l�tjd�}|jtt|��y�N�jottalib)�logging�	getLogger�setLevel�getattr)�	log_level�loggers  r�set_jottalib_logging_levelr1s%��
�
�
�z�
*�F�
�O�O�G�G�Y�/�0rc�^�tjd�}|D]}|j|��yr)rr�
addHandler)�handlersr�handlers   r�set_jottalib_log_handlersr"6s/��
�
�
�z�
*�F��#�����'�"�#rc�b�tjtj��}|dk(rd}|S)zHGet the current duplicity log level as a stdlib-compatible logging level�NOTICE�INFO)r�	LevelName�getverbosity)�duplicity_log_levels r�get_duplicity_log_levelr)<s0���-�-��(8�(8�(:�;���h�&�$���rc�@�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zy
)�JottaCloudBackendz,Connect to remote store using JottaCloud APIc��tjjj||�	ddlm}ddlm}m}t�}t|�ttjj �|j�|_|j%|j&j)d��|_tj,d|j*j&���y#t$rtd��wxYw)Nr)�JFS)�JFSNotFoundError�JFSIncompleteFilezQJottaCloud backend requires jottalib (see https://pypi.python.org/pypi/jottalib).�/z!Jottacloud folder for duplicity: )�	duplicity�backend�Backend�__init__rr-�jottalib.JFSr.r/�ImportErrorrr)rr"r�_loggerr �client�get_or_create_directory�path�lstrip�folder�Debug)�self�
parsed_urlr-r.r/r(s      rr4zJottaCloudBackend.__init__Js������!�!�*�*�4��<�		�$�
�6�7��"�#6�7�	"�#�+�+�"6�"6�7��g�g�i����2�2�:�?�?�3I�3I�#�3N�O����	�	�5�d�k�k�6F�6F�5I�J�K��!�	�"�f��
�	�s�C#�#C8c���t|j�}tj|j|�}	|jj|�S#t$r|j|�cYSwxYw�N)rr8�	posixpath�joinr:�	getObjectr.�mkdir)r>�directory_name�root_directory�	full_paths    rr9z)JottaCloudBackend.get_or_create_directoryfs`��%�d�k�k�2���N�N�>�#6�#6��G�	�	8��;�;�(�(��3�3���	8�!�'�'��7�7�	8�s�A�A/�.A/c��|jj|j�|�}tjd|j
�d|�d|���y)Nzjottacloud.put(�,�): )r<�up�openrr=r)r>�source_path�remote_filename�resps    r�_putzJottaCloudBackend._putnsH���{�{�~�~�k�.�.�0�/�B���	�	�O�K�$4�$4�#5�Q��6G�s�4�&�Q�Rrc�~�|jjtj|jj
|��}t
jd|�d|j�d|���t|jd�5}|j�D]}|j|��	ddd�y#1swYyxYw)Nzjottacloud.get(rJrK�wb)r8rDrBrCr<r:rr=rrM�stream�write)r>rO�
local_path�remote_file�to_file�chunks      r�_getzJottaCloudBackend._getts����k�k�+�+�I�N�N�4�;�;�;K�;K�_�,]�^���	�	�O�O�#4�A�j�o�o�5F�c�+��W�X�
�*�/�/�4�
(�	%�G�$�+�+�-�
%���
�
�e�$�
%�	%�	%�	%�s�'B3�3B<c��t|jj�D�cgc]-}|j�s|jdk7r|j
��/c}�Scc}w)N�
INCOMPLETE)�listr<�files�
is_deleted�stater)r>�fs  r�_listzJottaCloudBackend._list}sS������*�*�,�
���|�|�~�!�'�'�\�*A����
�
�	
��
s�2Ac��tj|jj|�}|jj|�}t
jd|�dt|��d��|j�y)Nzjottacloud.delete deleting: z (�))
rBrCr<r:r8rDrr=�type�delete�r>�filename�remote_pathrWs    r�_deletezJottaCloudBackend._delete�sa�� �n�n�T�[�[�%5�%5�x�@���k�k�+�+�K�8���	�	�0��
�R��[�@Q�?R�RS�T�U����rc��tjd|���tj|jj
|�}	|jj|�}d|jiS#t$rddicYSwxYw)zGet size of filenamezQuerying size of �size���)
r�InforBrCr<r:r8rDr.rlrgs    r�_queryzJottaCloudBackend._query�s}��
	���$�X�J�/�0��n�n�T�[�[�%5�%5�x�@��	 ��+�+�/�/��<�K�
�K�$�$�
�	
�� �	 ��B�<��	 �s�A-�-
A=�<A=c��yrA�)r>s r�_closezJottaCloudBackend._close�s��rN)�__name__�
__module__�__qualname__�__doc__r4r9rQrZrbrjrorrrqrrr+r+Gs/��6�L�88�S�%�

��

�
rr+�
jottacloud)rrB�duplicity.backendr1r�duplicity.errorsrr
rrr"r)r2r3r+�register_backendrqrr�<module>r{sh��2����-���1�
#��[
�	�)�)�1�1�[
�|
���"�"�<�1B�C�0r

Zerion Mini Shell 1.0