Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/debtcollector/__pycache__/_utils.cpython-39.pyc
Ðазад
a j�h� � @ sb d dl Z d dlZd dlZdZdZddd�Zdd� Zddd �Zd d� Zddd �Z dd� Z dd� ZdS )� N)�builtins� exceptionsTc C s@ t sdS |du rt}|du r,tj| |d� ntj| ||d� dS )a� Warns about some type of deprecation that has been (or will be) made. This helper function makes it easier to interact with the warnings module by standardizing the arguments that the warning function receives so that it is easier to use. This should be used to emit warnings to users (users can easily turn these warnings off/on, see https://docs.python.org/2/library/warnings.html as they see fit so that the messages do not fill up the users logs with warnings that they do not wish to see in production) about functions, methods, attributes or other code that is deprecated and will be removed in a future release (this is done using these warnings to avoid breaking existing users of those functions, methods, code; which a library should avoid doing by always giving at *least* N + 1 release for users to address the deprecation warnings). N)�category)r � stacklevel)�_enabled�DeprecationWarning�warnings�warn)�messager r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/debtcollector/_utils.py�deprecation s r c C s. zd| j fW S ty( d| jf Y S 0 d S )NTF)�__qualname__�AttributeError�__name__)�objr r r �get_qualified_name3 s r c C sh | g}|r|� d| � |r>|dkr0|� d� n|� d| � |rL|� |� |r^|� d| � d�|�S )zDHelper to generate a common message 'style' for deprecation helpers.z in version '%s'�?z( and will be removed in a future versionz$ and will be removed in version '%s'z: %s� )�append�join)�prefixZpostfixr �versionZremoval_versionZmessage_componentsr r r �generate_message; s � r c C s t jS )z:Helper to fix/workaround https://bugs.python.org/issue3445)� functools�WRAPPER_ASSIGNMENTS)� decoratorr r r �get_assignedO s r c C sf t | t�st| �} z| jtv }W n ty2 Y n0 |r>| jS |r\t| d�r\d| j| jf S | jS dS )z�Get class name for object. If object is a type, fully qualified name of the type is returned. Else, fully qualified name of the type of the object is returned. For builtin types, just name is returned. � __module__z%s.%sN)� isinstance�typer �_BUILTIN_MODULESr r �hasattr)r Zfully_qualifiedZbuilt_inr r r �get_class_nameT s r# c C s4 t �| �sdS zt| d�W S ty. Y dS 0 dS )z;Gets the ``self`` object attached to this method (or none).N�__self__)�inspect�ismethod�getattrr )�methodr r r �get_method_selfk s r) c C s@ t | �}|dur^t|t�r |}nt|�}z|j| jf}W n" tyZ |j|j| jf}Y n0 n�t�| �srt� | �r�z| j| jf}W n@ ty� t | d�r�| j}|j|j| jf}n| j| jf}Y n0 nFt| �}|tu r�| }z|j|jf}W n t�y |j|jf}Y n0 |d |dd� }}|�s2d�|�S d�|�S dS )zeGenerate a name from callable. Tries to do the best to guess fully qualified callable name. N�im_classr � �.) r) r r r r r r r% r&