%PDF- %PDF-
Direktori : /lib/python3/dist-packages/duplicity/__pycache__/ |
Current File : //lib/python3/dist-packages/duplicity/__pycache__/progress.cpython-312.pyc |
� �2e 6 � �� � d Z ddlmZmZ ddlZddlZddlZddlZddlZddl m Z ddl mZ ddl mZ da da G d� dej � Z G d � d e� Zd� Z G d� d ej( � Zy)a� Functions to compute progress of compress & upload files The heuristics try to infer the ratio between the amount of data collected by the deltas and the total size of the changing files. It also infers the compression and encryption ration of the raw deltas before sending them to the backend. With the inferred ratios, the heuristics estimate the percentage of completion and the time left to transfer all the (yet unknown) amount of data to send. This is a forecast based on gathered evidence. � )�datetime� timedeltaN)�config)�log)�utilc �V � � e Zd ZdZed� � Zd� Zd � fd� Zd� Zd� Z d� Z � fd�Z� xZS ) �Snapshotz� A convenience class for storing snapshots in a space/timing efficient manner Stores up to 10 consecutive progress snapshots, one for each volume c �� � t � } t j �lt j j dk\ rO t t j j � d�d� }t j |� } |j � | S | S # t $ rY}t j dt j |� � �t j j � t � } Y d}~| S d}~ww xY w)z9 De-serializes cached data it if present N� z /progress�rz@Warning, cannot read stored progress info from previous backup: )r r �restart� start_vol�open�archive_dir_path�name�pickle�load�close� Exceptionr �Warnr �uexc�WarningCode�cannot_stat)�snapshot� progressfd�es �4/usr/lib/python3/dist-packages/duplicity/progress.py� unmarshallzSnapshot.unmarshall; s� � � �:���>�>�%�&�.�.�*B�*B�a�*G� &�!�V�%<�%<�%A�%A�$B�)�"L�c�R� �!�;�;�z�2��� � �"� ��x��� � &����V�W[�W`�W`�ab�Wc�Vd�e��O�O�/�/�� $�:����� &�s �AB � C+�AC&�&C+c � � t dt j j z d� }t j | |� |j � y)z, Serializes object to cache s %s/progresszwb+N)r r r r r �dumpr )�selfr s r �marshallzSnapshot.marshallP s; � � �.�6�+B�+B�+G�+G�G��O� ����D�*�%����� c �<