%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/duplicity/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/duplicity/__pycache__/log.cpython-312.pyc

�

�2eJ>���dZddlZddlZddlZddlZdZdZdZdZdZ	dZ
dZdada
d�Zd	�Zd
�Zd1d�Zd�ZGd
�de�Zej*dfd�Zd2d�Zd�Zd�Zd�Zd3d�Zd3d�Zd3d�Zd�ZGd�de�Zej*dfd�Z Gd�de�Z!e!j*dfd�Z"e!j*dfd�Z#Gd�d ejH�Z%Gd!�d"ejH�Z&d#�Z'Gd$�d%ejP�Z)Gd&�d'ejP�Z*Gd(�d)ejP�Z+Gd*�d+ejH�Z,d,�Z-d-�Z.d.�Z/d/�Z0d0�Z1y)4z1Log various messages depending on verbosity level�N����	Fc��t|z
dzS)zWConvert duplicity level to the logging module's system, where higher is
    more severe�)�MAX��verbs �//usr/lib/python3/dist-packages/duplicity/log.py�DupToLoggerLevelr
+s����:��>��c��t|�S)zRConvert logging module level to duplicity's system, where lower is
    more severe)r
r
s r�LoggerToDupLevelr1s���D�!�!rc�4�|dk\ry|dk\ry|dk\ry|dk\ryy	)
Nr�DEBUGr�INFOr�NOTICEr�WARNING�ERROR�)�levels r�	LevelNamer7s-����z��	�!���	�!���	�!���rc��|rt|��d|��}nt|��}|sd}|r6tj�}tjt	t
��t
|t�s|jdd�}tjt	|�|t|�||d���|rtj�yy)z/Write s to stderr if verbosity level low enough� ��utf8�replace)�	levelName�controlLine�transferProgress)�extraN)�int�_logger�getEffectiveLevel�setLevelr
r	�
isinstance�str�decode�logr)�s�
verb_level�coder"�force_print�transfer_progressr �
initial_levels        r�Logr1Ds���
��T���1�U�G�,���T���������1�1�3�
����)�#�.�/��a���
�H�H�V�Y�'���K�K���$�	�"�:�.�&� 1�
��������'�rc�$�t|t�y)z.Shortcut used for debug message (verbosity 9).N)r1r�r+s r�Debugr4gs����5�Mrc�L�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZy)�InfoCodez�Enumeration class to hold info code values.
    These values should never change, as frontends rely upon them.
    Don't use 0 or negative numbers.rrr�r����
���
���N)�__name__�
__module__�__qualname__�__doc__�generic�progress�collection_status�
diff_file_new�diff_file_changed�diff_file_deleted�patch_file_writing�patch_file_patching�	file_list�synchronous_upload_begin�asynchronous_upload_begin�synchronous_upload_done�asynchronous_upload_done�skipping_socket�upload_progressrrrr6r6ls]��(��G��H����M����������I�!�� "�� ��!���O��Orr6c�(�t|t||�y)z.Shortcut used for info messages (verbosity 5).N)r1r�r+r-r"s   r�InforW�s����4��u�rc��|rt|��dt|���}nt|��}t|ttj|�y)z2Shortcut used for progress messages (verbosity 5).rN)r#r1rr6rG)r+�current�totalr s    r�Progressr[�s<����W���a��E�
�|�4���W������4��"�"�K�0rc�(�tj|��}t|jd�\}}t|d�\}}d}|jdkDrt|j��d�}|�t|�d�dt|�d�dt|�d��}|S)	N��seconds��<rrzd,�02�:��datetime�	timedelta�divmodr^�daysr#��secs�tdelta�hours�rem�minutesr^�fmts       r�_ElapsedSecs2Strro�s���
�
�
��
-�F������-�J�E�3��c�2���G�W�
�C�
�{�{�Q���V�[�[�!�"�"�%��
�E�#�e�*�R���#�g�,�r�!2�!�C��L��3D�
E�C��Jrc�@�tj|��}t|jd�\}}t|d�\}}d}|jdkDrFt|j��d�}|dkDr|�dt|��d�}|dkDr|�dt|��d	�}|S|dkDr&t|��d�}|dkDr|�dt|��d	�}|S|d
kDrt|��d	�}|S|dkDrt|��d	�}|dk\r|�d�}|S|d
kDrd}|S|dkDrd}|S|dkDrd}|St|��d�}|S)Nr]r_r`rr�dr�h�minr�z 30sec�-z< 1minz< 45secr@z< 30sec�secrcrhs       r�_RemainingSecs2Strrw�s���
�
�
��
-�F������-�J�E�3��c�2���G�W�
�C�
�{�{�Q���V�[�[�!�"�!�$���1�9��E��3�u�:�,�a�(�C��Q�;��E��3�w�<�.��,�C�&�J�%
����U���A����Q�;��E��3�w�<�.��,�C��J�
�1���W���c�"���J�
�1���W���c�"���b�=��E��.�C��J�
�2�����J�

�2����
�J�	
�2�����J��W���c�"���Jrc�,�td|z�}t|�dz}d}|dkDr|dz}d}|dkDr|dz}d}|rd}	d}
d	}n3t|�}	t|�dz}
d}|
dkDr|
dz}
d}|
dkDr|
dz}
d}|d
�|�dt|��d|
d
�|�d
d|z�ddd|z
z�dt|��d|	��}t|��dt|��dt|��dt|��dt|��dt|���}
t	|t
tj|
d��y)z9Shortcut used for upload progress messages (verbosity 5).g�������?g�@�KBg@�@�MB�GBzStalled!r�Bz.1frz [z/s] [�=�>�(z] z% ETA T)r/N)r#�floatrwror1rr6rT)rG�eta�
changed_bytes�elapsed�speed�stalled�dots�data_amount�
data_scale�eta_str�speed_amount�speed_scaler+r s              r�TransferProgressr��sv���s�X�~��D��
�&��/�K��J��V���v����
��V���v����
��������$�S�)���U�|�f�,�����&� ��F�"�L��K��&� ��F�"�L��K��s�
�J�<�q�)9�'�)B�(C�2�l�SV�EW�Xc�Wd�e��$�J�<�q���T�	�*�+�2�c�(�m�_�F�7�)�	M��
��'�(��#�g�,��q��X���q��S��
�RS�TW�X]�T^�S_�_`�ad�el�am�`n�o�K���6�8�+�+�[�D�Qrc
��tt|�dtjddj	|j��z|�y)�%Prints a collection status to the logr:�
N)r1r(r6rH�join�to_log_info)�	col_statsr.s  r�PrintCollectionStatusr��s:����I��	��"�"��t�y�y��.�.�0�1�1��rc�n�tt|j|��dtjd|�y)r�r:N)r1r(�get_file_changed_recordr6rH)r��filepathr.s   r� PrintCollectionFileChangedStatusr��s/����I�-�-�h�7�8�	��"�"���rc�n�tt|j|��dtjd|�y)z.Prints changes in the specified set to the logr:N)r1r(�get_all_file_changed_recordsr6rH)r��	set_indexr.s   r�PrintCollectionChangesInSetr��s/����I�2�2�9�=�>�	��"�"���rc�$�t|t�y)z=Shortcut used for notice messages (verbosity 3, the default).N)r1rr3s r�Noticer��s����6�Nrc�D�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZy)�WarningCodez�Enumeration class to hold warning code values.
    These values should never change, as frontends rely upon them.
    Don't use 0 or negative numbers.rrrr7rr8r9r:rr;r<r=r>N)rBrCrDrErF�orphaned_sig�unnecessary_sig�
unmatched_sig�incomplete_backup�orphaned_backup�ftp_ncftp_v320�cannot_iterate�cannot_stat�cannot_read�no_sig_for_time�cannot_process�process_skippedrrrr�r�sK��(��G��L��O��M����O��N��N��K��K��O��N��Orr�c�(�t|t||�y)z0Shortcut used for warning messages (verbosity 2)N)r1rrVs   r�Warnr�s����7�D�%� rc���eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$Z&d%Z'd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;y:);�	ErrorCodez�Enumeration class to hold error code values.
    These values should never change, as frontends rely upon them.
    Don't use 0 or negative numbers.  This code is returned by duplicity
    to indicate which error occurred via both exit code and log.rrrr7rr8r9r:rr;r<r=r>r?r@rA���������rt��!�"�#�$�%�&�'r�*�+�,ru�.�/�0�1�2�3�4�5�6�7�F�G�H�I�P�Q�RN)<rBrCrDrErF�command_line�hostname_mismatch�no_manifests�mismatched_manifests�unreadable_manifests�cant_open_filelist�bad_url�bad_archive_dir�deprecated_option�restore_path_exists�verify_dir_doesnt_exist�backup_dir_doesnt_exist�file_prefix_error�globbing_error�redundant_inclusion�inc_without_sigs�no_sigs�restore_path_not_found�no_restore_files�mismatched_hash�unsigned_volume�
user_error�ftp_ncftp_missing�ftp_ncftp_too_old�	exception�
gpg_failed�not_implemented�get_freespace_failed�not_enough_freespace�get_ulimit_failed�maxopen_too_low�connection_failed�restart_file_not_found�gio_not_available�source_path_mismatch�ftps_lftp_missing�volume_wrong_size�enryption_mismatch�pythonoptimize_set�dpbx_nologin�bad_request�s3_kms_no_id�
backend_error�backend_permission_denied�backend_not_found�backend_no_space�backend_command_error�backend_code_error�redundant_filter�trailing_filter�absolute_files_from�empty_files_from�bad_sign_key�bad_encrypt_key�bad_hidden_encrypt_keyrrrr�r�sM��D�
�G��L����L��������G��O����� �� �����N������G������O��O��J������I��J��O��������O������������������L��K��L��M� "�������������O������L��O��rr�c�(�t|t||�y)zWrite error messageN)r1rrVs   r�Errorr
ns����5�$��rc�f�t|t||�t�tj|�y)z"Write fatal error message and exitN)r1r�shutdown�sys�exitrVs   r�
FatalErrorrss ����5�$����J��H�H�T�Nrc��eZdZdZd�Zy)�	OutFilterz:Filter that only allows warning or less important messagesc�V�|jxr|jtt�kS�N��msg�levelnor
r��self�records  r�filterzOutFilter.filter}s ���z�z�I�f�n�n�0@��0I�I�IrN�rBrCrDrErrrrrrzs��D�Jrrc��eZdZdZd�Zy)�	ErrFilterz=Filter that only allows messages more important than warningsc�V�|jxr|jtt�kDSrrrs  rrzErrFilter.filter�s ���z�z�H�f�n�n�/?��/H�H�HrNrrrrr r �s��G�Irr c��trydtjddvrdat	j
d�at
t�t	jtj�}tr|jt��n|jt��|jt��tj|�t	jtj �}tr|jt��n|jt��|jt#��tj|�y)zInitialize loggingNz--log-timestamprT�	duplicity)r$r�argv�_log_timestamp�logging�	getLogger�setverbosityr�
StreamHandler�stdout�setFormatter�DetailFormatter�PrettyProgressFormatter�	addFilterr�
addHandler�stderrr )�
outHandler�
errHandlers  r�setupr3�s������C�H�H�Q�R�L�(�������,�G�����&�&�s�z�z�2�J������ 1�2���� 7� 9�:������%����z�"��&�&�s�z�z�2�J������ 1�2���� 7� 9�:������%����z�"rc� �eZdZdZdZd�Zd�Zy)r-zCFormatter that overwrites previous progress lines on ANSI terminalsFc�D�tjj|d�y)Nz%(message)s�r&�	Formatter�__init__�rs rr8z PrettyProgressFormatter.__init__�s��	���"�"�4��7rc��tjj||�}|jr|jrd|z}|j|_|S)Nz)r&r7�format�last_record_was_progressr!�rrr+s   rr;zPrettyProgressFormatter.format�sJ�����$�$�T�6�2���(�(�V�-D�-D��!�#�A�(.�(?�(?��%��rN)rBrCrDrEr<r8r;rrrr-r-�s��M�$��8�
rr-c��eZdZdZd�Zd�Zy)r,zAFormatter that creates messages in a syntax somewhat like syslog.c�D�tjj|d�y)Nz%%(asctime)s %(levelName)s %(message)sr6r9s rr8zDetailFormatter.__init__�s��	���"�"�4�)P�Qrc�F�tjj||�}|Sr)r&r7r;r=s   rr;zDetailFormatter.format�s�����$�$�T�6�2���rN�rBrCrDrEr8r;rrrr,r,�s��K�R�rr,c��eZdZdZd�Zd�Zy)�MachineFormatterzQFormatter that creates messages in a syntax easily consumable by other processes.c�D�tjj|d�y)Nz%(levelName)s %(controlLine)sr6r9s rr8zMachineFormatter.__init__�s��	���"�"�4�)H�Irc��tjj||�}|jr"|d|jzj	dd�z
}|dzS)Nr�z
. )r&r7r;�messagerr=s   rr;zMachineFormatter.format�sN�����$�$�T�6�2���>�>�
�$����'�0�0��v�>�>�A��4�x�rNrArrrrCrC�s��[�J�	rrCc��eZdZdZd�Zy)�
MachineFilterzFFilter that only allows levels that are consumable by other processes.c��t|d�S)Nr)�hasattrrs  rrzMachineFilter.filter�s���v�{�+�+rNrrrrrHrH�s
��P�,rrHc���tjtj|d��}|j	t��|j
t��tj|�y)z5Add stream to which to write machine-readable logging�wN)
r&r)�os�fdopenr+rCr.rHr$r/)�fd�handlers  r�add_fdrQ�sO���#�#�B�I�I�b�#�$6�7�G����)�+�,����m�o�&����w�rc��tj|d��}|jt��|j	t��tj|�y)z3Add file to which to write machine-readable loggingr)�encodingN)r&�FileHandlerr+rCr.rHr$r/)�filenamerPs  r�add_filerV�sF���!�!�(�V�<�G����)�+�,����m�o�&����w�rc�@�tjt|��y)zSet the verbosity levelN)r$r&r
r
s rr(r(s�����%�d�+�,rc�<�ttj��S)zGet the verbosity level)rr$r%rrr�getverbosityrY
s���G�5�5�7�8�8rc�,�tj�y)zCleanup and flush loggersN)r&rrrrrrs�����r)rNFFr)F)2rErdr&rMr�MINrrrrrr	r$r%r
rrr1r4�objectr6rFrWr[rorwr�r�r�r�r�r�r�r�r
r�Filterrr r3r7r-r,rCrHrQrVr(rYrrrr�<module>r^s���08���	�
���	��
��	
����	����
�����"�
� (�F�
�v��.�!�!���
1���@R�D����
�&��(�$�$�D�!�
J ��J �b�#�#�4��
!�(�(���J����J�I����I�!#�H�g�/�/��4
�g�'�'�
� �w�(�(��.,�G�N�N�,� � �-�9�r

Zerion Mini Shell 1.0