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__/dup_threading.cpython-310.pyc
o

��@a"�@s�dZddlmZe��ddlmZddlZddlmZdZ	zddl
Z
Wney3ddlZ
dZ	Ynwzddl
Z
WneyIddlZ
dZ	Ynwdd	�Zdd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�ZGdd�de�ZdS)z�
Duplicity specific but otherwise generic threading interfaces and
utilities.

(Not called "threading" because we do not want to conflict with
the standard threading module, and absolute imports require
at least python 2.5.)
�)�standard_library)�objectN)�errorsTFcC�tS)zU
    Returns whether threading is supported on the system we are
    running on.
    )�_threading_supported�rr�9/usr/lib/python3/dist-packages/duplicity/dup_threading.py�threading_supported4�r	cCs&t�s|dur	d}t�d|f��dS)a
    Assert that threading is required for operation to continue. Raise
    an appropriate exception if this is not the case.

    Reason specifies an optional reason why threading is required,
    which will be used for error reporting in case threading is not
    supported.
    Nz(no reason given)zQthreading was needed because [%s], but is not supported by the python interpreter)r	r�NotSupported)�reasonrrr�require_threading<s	��r
cCr)zW
    Returns the thread module, or dummy_thread if threading is not
    supported.
    )�_threadrrrr�
thread_moduleMr
rcCr)zZ
    Returns the threading module, or dummy_thread if threading is not
    supported.
    )�	threadingrrrr�threading_moduleUr
rcCs$|��z|�W|��S|��w)a
    Call fn with lock acquired. Guarantee that lock is released upon
    the return of fn.

    Returns the value returned by fn, or raises the exception raised
    by fn.

    (Lock can actually be anything responding to acquire() and
    release().)
    )�acquire�release)�lock�fnrrr�	with_lock]srcCs|�s
|�d�|�rdSdS)a�
    cv   - The threading.Condition instance to wait on
    test - Callable returning a boolean to indicate whether
           the criteria being waited on has been satisfied.

    Perform a wait on a condition such that it is keyboard
    interruptable when done in the main thread. Due to Python
    limitations as of <= 2.5, lock acquisition and conditions waits
    are not interruptable when performed in the main thread.

    Currently, this comes at a cost additional CPU use, compared to a
    normal wait. Future implementations may be more efficient if the
    underlying python supports it.

    The condition must be acquired.

    This function should only be used on conditions that are never
    expected to be acquired for extended periods of time, or the
    lock-acquire of the underlying condition could cause an
    uninterruptable state despite the efforts of this function.

    There is no equivalent for acquireing a lock, as that cannot be
    done efficiently.

    Example:

    Instead of:

      cv.acquire()
      while not thing_done:
        cv.wait(someTimeout)
      cv.release()

    do:

      cv.acquire()
      interruptable_condwait(cv, lambda: thing_done)
      cv.release()
    g�������?N)�wait)�cv�waitForrrr�interruptably_waitps/
�rcs>t���ddddd����fdd������fdd�}�|fS)a�
    Splits the act of calling the given function into one front-end
    part for waiting on the result, and a back-end part for performing
    the work in another thread.

    Returns (waiter, caller) where waiter is a function to be called
    in order to wait for the results of an asynchronous invokation of
    fn to complete, returning fn's result or propagating it's
    exception.

    Caller is the function to call in a background thread in order to
    execute fn asynchronously. Caller will return (success, waiter)
    where success is a boolean indicating whether the function
    suceeded (did NOT raise an exception), and waiter is the waiter
    that was originally returned by the call to async_split().
    FN)�done�error�trace�valuecsV���z!t��fdd���ddur�dW���S�d��d�����w)Ncs�dS)Nrrr)�staterr�<lambda>�sz-async_split.<locals>.waiter.<locals>.<lambda>rrr)rrr�with_tracebackr)rrrr�waiter�s
�
zasync_split.<locals>.waiterc
s�z��}���d�d<|�d<������d�fWStyN}z&���d�d<|�d<t��d�d<������d�fWYd}~Sd}~ww)NTrrr�rF)r�notifyr�	Exception�sys�exc_info)r�e�rrrr"rr�caller�s$
��zasync_split.<locals>.caller)r�	Condition)rr*rr)r�async_split�s�r,c@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�Valuea�
    A thread-safe container of a reference to an object (but not the
    object itself).

    In particular this means it is safe to:

      value.set(1)

    But unsafe to:

      value.get()['key'] = value

    Where the latter must be done using something like:

      def _setprop():
        value.get()['key'] = value

      with_lock(value, _setprop)

    Operations such as increments are best done as:

      value.transform(lambda val: val + 1)
    NcCs||_t��|_dS)z2
        Initialuze with the given value.
        N)�
_Value__valuerr+�
_Value__cv��selfrrrr�__init__�szValue.__init__cst�j�fdd��S)z<
        Returns the value protected by this Value.
        cs�jS�N�r.r�r1rrr szValue.get.<locals>.<lambda>�rr/r5rr5r�getsz	Value.getcs��fdd�}t�j|�dS)z;
        Resets the value protected by this Value.
        cs
��_dSr3r4rr0rr�_sets
zValue.set.<locals>._setNr6)r1rr8rr0r�set
sz	Value.setcs��fdd�}t�j|�S)ah
        Call fn with the current value as the parameter, and reset the
        value to the return value of fn.

        During the execution of fn, all other access to this Value is
        prevented.

        If fn raised an exception, the value is not reset.

        Returns the value returned by fn, or raises the exception
        raised by fn.
        cs��j��_�jSr3r4r�rr1rr�
_transform#sz#Value.transform.<locals>._transform)rr)r1rr;rr:r�	transforms
zValue.transformcC�|j��dS)z�
        Acquire this Value for mutually exclusive access. Only ever
        needed when calling code must perform operations that cannot
        be done with get(), set() or transform().
        N)r/rr5rrrr)sz
Value.acquirecCr=)zC
        Release this Value for mutually exclusive access.
        N)r/rr5rrrr1sz
Value.releaser3)
�__name__�
__module__�__qualname__�__doc__r2r7r9r<rrrrrrr-�s
	r-r3)rA�futurer�install_aliases�builtinsrr&�	duplicityrrr�ImportError�
_dummy_threadr�dummy_threadingr	r
rrrrr,r-rrrr�<module>s6	��
3C

https://t.me/RX1948 - 2025