File: //kunden/lib/python3/dist-packages/breezy/__pycache__/symbol_versioning.cpython-39.pyc
a
�*�^�6 � @ s� d Z ddlmZ g d�ZddlZddlma ddlZdZdd� Zd d
� Z dd� Z
d
d� Zdd� Zdd� Z
dd� Zdd� Zdd� ZG dd� de�Zd&dd�Zdd� Zdd � Zd'd"d#�Zd(d$d%�ZdS ))zESymbol versioning
The methods here allow for api symbol versioning.
� )�absolute_import)�deprecated_function�
deprecated_in�deprecated_list�deprecated_method�DEPRECATED_PARAMETER�deprecated_passed�set_warning_method�warnN�r
zA deprecated parameter marker.c C s dt �| � S )z�Generate a message that something was deprecated in a release.
>>> deprecated_in((1, 4, 0))
'%s was deprecated in version 1.4.0.'
z!%%s was deprecated in version %s.)�breezyZ_format_version_tuple)Z
version_tuple� r
�:/usr/lib/python3/dist-packages/breezy/symbol_versioning.pyr - s �r c C s | a dS )z�Set the warning method to be used by this module.
It should take a message and a warning category as warnings.warn does.
Nr )�methodr
r
r r 7 s r c C sr t | dd�dur.d| jjj| jjj| jf }n<t | dd�durZd| jvrZd| j| jf }nd| j| jf }|| S )ao Generate an automatic deprecation string for a_callable.
:param a_callable: The callable to substitute into deprecation_version.
:param deprecation_version: A deprecation format warning string. This
should have a single %s operator in it. a_callable will be turned into
a nice python symbol and then substituted into deprecation_version.
�__self__N�%s.%s.%s�__qualname__�<�%s.%s)�getattrr � __class__�
__module__�__name__r )Z
a_callable�deprecation_version�symbolr
r
r �deprecation_stringF s
���r c s � fdd�}|S )z=Decorate a function so that use of it will trigger a warning.c s � �fdd�}t � �d|� |S )�<This is the function python calls to perform the decoration.c s: ddl m} |�dd� tt� ��tdd� � | i |��S )zThis is the decorated function.� ��trace� zDeprecated function called� ��
stacklevel)� r �mutter_callsiter
r �DeprecationWarning)�args�kwargsr ��callabler r
r �decorated_functiona s
�zKdeprecated_function.<locals>.function_decorator.<locals>.decorated_functionZfunction��_populate_decorated)r* r+ �r �r* r �function_decorator^ s
�z/deprecated_function.<locals>.function_decoratorr
)r r0 r
r. r r [ s
r c s � fdd�}|S )z�Decorate a method so that use of it will trigger a warning.
To deprecate a static or class method, use
@staticmethod
@deprecated_function
def ...
To deprecate an entire class, decorate __init__.
c s � �fdd�}t � �d|� |S )r c sx ddl m} � jdkr,d| jj| jjf }nd| jj| jj� jf }|�dd� t�| tdd � � | g|�R i |��S )
zThis is the decorated method.r r �__init__r r r zDeprecated method calledr! r"