Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/fabric/__pycache__/decorators.cpython-39.pyc
Ðазад
a {�hk � @ s� d Z ddlZddlZddlmZ zddlmZ W n eyF dZY n0 ddlm Z ddl mZ dd � Zd d� Z dd � Zdd� Zdd� Zdd� Zdd� Zddd�Zdd� ZdS )z- Convenience decorators for use in fabfiles. � N)�wraps)�Random)�tasks� ��settingsc sN t � p ��}��dtj��|s.� d d }� � ��fdd�}|rF|S ||�S )a� Decorator declaring the wrapped function to be a new-style task. May be invoked as a simple, argument-less decorator (i.e. ``@task``) or with arguments customizing its behavior (e.g. ``@task(alias='myalias')``). Please see the :ref:`new-style task <task-decorator>` documentation for details on how to use this decorator. .. versionchanged:: 1.2 Added the ``alias``, ``aliases``, ``task_class`` and ``default`` keyword arguments. See :ref:`task-decorator-arguments` for details. .. versionchanged:: 1.5 Added the ``name`` keyword argument. .. seealso:: `~fabric.docs.unwrap_tasks`, `~fabric.tasks.WrappedCallableTask` � task_classr � c s �| g� �R i ���S �Nr ��func��args�kwargsr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/fabric/decorators.py�wrapper( s ztask.<locals>.wrapper)�bool�popr �WrappedCallableTask)r r Zinvokedr r r r r �task s r c C s t | tj�rt�|�S |S r )� isinstancer �Taskr )�original�newr r r �_wrap_as_new- s r c s � �fdd�}|S )Nc sZ t � �� fdd��}�}t|�dkr<t|d tj�s<|d }t|�t|�� t� |�}|S )Nc s � | i |��S r r �r r r r r �inner_decorator5 s zH_list_annotating_decorator.<locals>.attach_list.<locals>.inner_decoratorr r )r �lenr �six�string_types�setattr�listr )r r Z_values�� attribute�valuesr r �attach_list4 s z/_list_annotating_decorator.<locals>.attach_listr )r# r$ r% r r"