https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/duplicity/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/duplicity/__pycache__/util.cpython-310.pyc
o

�0ka�)�@sxdZddlmZddlmZe��ddlmZddlmZddlm	Z	ddlm
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZdd	lmZddlmZddlmZz
dd
l
mZmZWneysdd�Zd
d�ZYnwd.dd�Zdd�Zdd�Zdd�Zdd�ZGdd�de �Z!Gdd�de	�Z"dd�Z#d d!�Z$d"d#�Z%ej&d$d%��Z'd/d'd(�Z(d)d*�Z)d0d,d-�Z*dS)1z
Miscellaneous utilities.
�)�print_function)�standard_library)�
isinstance)�map)�object)�strN)�tarfile)�fsencode�fsdecodecCs|�t��d�S)zGConvert a unicode filename to a filename encoded in the system encoding�replace)�encode�sys�getfilesystemencoding)�unicode_filename�r�0/usr/lib/python3/dist-packages/duplicity/util.pyr	>sr	cCs|�tjd�S)z<Convert a filename encoded in the system encoding to unicoder)�decode�config�
fsencoding)�bytes_filenamerrrr
Esr
�2cCs�t��\}}}t�||�}|�t�||��d}tjjdkr1|dt�	d|dd��|df}n|dt
�	|dd�d�|df}tjjdkrO|�dd�S|S)	zx
    @return A string representation in typical Python format of the
            currently active/raised exception.
    zTraceback (innermost last):
�z%-20s %s�N����unicode-escaper)r
�exc_info�	traceback�	format_tb�extend�format_exception_only�version_info�majorr�join�stringr)�limit�type�value�tb�lines�msgrrr�exception_tracebackNs&$r*cCs(t|��dd�}d|�dd��dd�S)zIConvert a (bytes) filename to a format suitable for logging (quoted utf8)rrz'%s'�utf8�'z\x27)r
rrr)r#rrr�escapecsr-cCs|r
tjjttt|���SdS)z@Convert an index (a tuple of path parts) to unicode for printing�.)�os�pathr"�listrr
)�indexrrr�uindexisr3cCs\|r,|jr,|jD]}t|t�r|St|t�rt|�Sqtjddkr*t|�SdSdS)z(Returns the exception message in Unicoder�r)�argsrr�bytesr
r
r )�e�mrrr�uexcqs



�r9c
CsVz|�WSty*}ztjr%t�td�|jjt|�f�WYd}~dS�d}~ww)a
    Execute fn. If the global configuration setting ignore_errors is
    set to True, catch errors and log them but do continue (and return
    None).

    @param fn: A callable.
    @return Whatever fn returns when called, or None if it failed and ignore_errors is true.
    z;IGNORED_ERROR: Warning: ignoring error as requested: %s: %sN)	�	Exceptionr�
ignore_errors�log�Warn�_�	__class__�__name__r9)�fnr7rrr�maybe_ignore_errors�s	
���rBc@seZdZdd�ZdS)�
BlackHoleListcC�dS�Nr)�self�xrrr�append��zBlackHoleList.appendN)r@�
__module__�__qualname__rHrrrrrC�srCc@s eZdZdZdd�Zdd�ZdS)�FakeTarFilercCstg�SrE)�iter�rFrrr�__iter__�szFakeTarFile.__iter__cCrDrErrNrrr�close�rIzFakeTarFile.closeN)r@rJrK�debugrOrPrrrrrL�srLcCs8zt�d||�}t�|_|WStjyt�YSw)N�	arbitrary)r�TarFilerC�members�	ReadErrorrL)�mode�fp�tfrrr�make_tarfile�s
�rYcCs$|��r|j�d�s|jdS|jS)N�/)�isdir�name�endswith)�tirrr�get_tarinfo_name�s
r_c
CsFz||�WdSty"}z|jtjkrn�WYd}~dSd}~ww)z�
    Execute fn on filename.  Ignore ENOENT errors, otherwise raise exception.

    @param fn: callable
    @param filename: string
    N)�OSError�errno�ENOENT)rA�filename�exrrr�ignore_missing�s���rec
Cs�tjr>t�td�tj�ztj��dt_t�tj�dt_WdSt	y=}zt�
dt|��WYd}~dSd}~wwdS)NzReleasing lockfile %srzCould not release lockfile: %s)r�lockfiler<�Debugr>�lockpath�releaser/�remover:�Errorr)r7rrr�release_lockfile�s
���rlrcCs�d}d}|dkr	|�|�}|s	|S|t|�7}|�|�q	|||kr>|�|�}|s-n|t|�7}|�|�|||ks%|�||�}|t|�7}|�|�|S)z�Copy byte_count bytes from infp to outfp, or all if byte_count < 0

    Returns the number of bytes actually written (may be less than
    byte_count if find eof.  Does not close either fileobj.

    ir)�read�len�write)�infp�outfp�
byte_count�	blocksize�
bytes_written�bufrrr�copyfileobj�s,

�
�

�
rvcCsxdd�}tj�|�\}}|r||�r|SdSt�d��tj�D]}|�d�}tj�tj�||��}||�r9|SqdS)zW
    Return absolute path for program name.
    Returns None if program not found.
    cSs&tj�|�otj�|�ot�|tj�SrE)r/r0�isfile�isabs�access�X_OK)�fpathrrr�is_exe
s&zwhich.<locals>.is_exe�PATH�"N)r/r0�split�getenv�pathsep�strip�abspathr")�programr|r{�fnamer0�exe_filerrr�whichs�
�r�Fcs�t�dd�s`dtjvst�dd�rb|r-d�d�gd�}��fdd�|D�}t�|�tjd	<d
dl}|jddd
d
d�tj	�
d
�}|�tj	j�dd�}tj	j�
|�}tj	�d
|�dtjd<dSdSdS)N�
DEBUG_RUNNINGz--pydevd�PYDEVDz(/Users/ken/workspace/duplicity-testfilesz'/home/ken/workspace/duplicity-testfiles)r�bin�	duplicityzduplicity/backends�testingztesting/functionalztesting/unitc	s8g|]}tj�tj��|��tj�tj��|��f�qSr)r/r0�normpathr")�.0�p��client�serverrr�
<listcomp>.s
��z"start_debugger.<locals>.<listcomp>�PATHS_FROM_ECLIPSE_TO_PYTHONrzdione.locali.T)�port�stdoutToServer�stderrToServerr�yes)r/r�r
�argv�json�dumps�environ�pydevd�settracer0�popr�sepr"�insert)�remote�duppaths�pathlistr��baserr�r�start_debuggers""	��r�)r)r)F)+�__doc__�
__future__r�futurer�install_aliases�builtinsrrrrrar�r/r#r
r�atexitr�r�duplicity.configr�
duplicity.logr<r	r
�ImportErrorr*r-r3r9rBr1rCrLrYr_re�registerrlrvr�r�rrrr�<module>sN
�







https://t.me/RX1948 - 2025