Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/web/__pycache__/_element.cpython-39.pyc
Ðазад
a k�h7 � @ s� d dl mZmZmZmZmZmZmZ d dlm Z d dl mZmZm Z d dlmZmZmZ erld dlmZmZ ed�ZG dd� d�Zeed �d d�Zedd �dd��Ze e�G dd� d��ZdS )� )� TYPE_CHECKING�Callable�List�Optional�TypeVar�Union�overload)�implementer)�MissingRenderMethod�MissingTemplateLoader�UnexposedMethodError)�IRenderable�IRequest�ITemplateLoader)�Flattenable�Tag�Tc @ st e Zd ZdZeed�dd�Ze� Zeee ed�dd��Z eee eeeef d�d d��Z efee eed�d d�Z dS )�Exposea/ Helper for exposing methods for various uses using a simple decorator-style callable. Instances of this class can be called with one or more functions as positional arguments. The names of these functions will be added to a list on the class object of which they are methods. )�funcObjs�returnc G s@ |st d��|D ]&}t|dg �}|�| � t|d|� q|d S )a; Add one or more functions to the set of exposed functions. This is a way to declare something about a class definition, similar to L{zope.interface.implementer}. Use it like this:: magic = Expose('perform extra magic') class Foo(Bar): def twiddle(self, x, y): ... def frob(self, a, b): ... magic(twiddle, frob) Later you can query the object:: aFoo = Foo() magic.get(aFoo, 'twiddle')(x=1, y=2) The call to C{get} will fail if the name it is given has not been exposed using C{magic}. @param funcObjs: One or more function objects which will be exposed to the client. @return: The first of C{funcObjs}. z,expose() takes at least 1 argument (0 given)�exposedThroughr )� TypeError�getattr�append�setattr)�selfr ZfObjr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/web/_element.py�__call__"