%PDF- %PDF-
Direktori : /lib/python3/dist-packages/duplicity/__pycache__/ |
Current File : //lib/python3/dist-packages/duplicity/__pycache__/librsync.cpython-312.pyc |
� �2e6! � �< � d Z ddlZddlZddlmZ ej j d� dk( r ddlmZ ddl Z ej � e _ ej Z G d� de � Z G d � d e� Z G d� de� Z G d � de� Z G d� de� Z G d� de� Zy)z�Provides a high-level interface to some librsync functions This is a python wrapper around the lower-level _librsync module, which is written in C. The goal was to use C as little as possible... � N� )� _librsync�READTHEDOCS�Truec � � e Zd ZdZy)� librsyncErrora/ Signifies error in internal librsync processing (bad signature, etc.) underlying _librsync.librsyncError's are regenerated using this class because the C-created exceptions are by default unPickleable. There is probably a way to fix this in _librsync, but this scheme was easier. N)�__name__� __module__�__qualname__�__doc__� � �4/usr/lib/python3/dist-packages/duplicity/librsync.pyr r + s � �� r r c �B � e Zd ZdZdZdZd d�Zd d�Zdd�Zd� Z d� Z d � Zy)�LikeFilez:File-like object used by SigFile, DeltaFile, and PatchFile�rbNc � � | j ||� || _ dx| _ | _ d| _ t j d� | _ dx| _ | _ y)z1LikeFile initializer - zero buffers, set eofs offNr �b) � check_file�infile�closed� infile_closed�inbuf�array�outbuf�eof� infile_eof)�selfr � need_seeks r �__init__zLikeFile.__init__A sK � ����� �*����+/�/���d�(��� ��k�k�#�&���%)�)���4�?r c � � t |d� st d� �t |d� st d� �|rt |d� st d� �yy)z:Raise type error if file doesn't have necessary attributes�readz$Basis file must have a read() method�closez%Basis file must have a close() method�seekz$Basis file must have a seek() methodN)�hasattr� TypeError)r �filer s r r zLikeFile.check_fileJ sM � ��t�V�$��B�C�C��t�W�%��C�D�D��W�T�6�2��B�C�C� 3�9r c �� � |dk( r?| j s| j � | j s�t | j � }nx| j sMt | j � |k r5| j � | j st | j � |k r�5t |t | j � � }| j d| j � }| j d|�= |S )z/Build up self.outbuf, return first length bytes���N)r �_add_to_outbuf_once�lenr �min�tobytes)r �length�real_len� return_vals r r"