| Server IP : 162.144.4.212 / Your IP : 216.73.216.108 Web Server : Apache System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/libexec/oracle-cloud-agent/plugins/osms/falcon/ |
Upload File : |
a
[��f�$ � @ s\ d Z ddlmZ ddlZddlmZ ddlmZ dd� Zdd � Z d
d� Z
dd
� Zdd� ZdS )zHook decorators.� )�wrapsN)�COMBINED_METHODS)�get_argnamesc s � ��fdd�}|S )a� Decorator to execute the given action function *before* the responder.
Args:
action (callable): A function of the form
``func(req, resp, resource, params)``, where `resource` is a
reference to the resource class instance associated with the
request, and `params` is a dict of URI Template field names,
if any, that will be passed into the resource responder as
kwargs.
Note:
Hooks may inject extra params as needed. For example::
def do_something(req, resp, resource, params):
try:
params['id'] = int(params['id'])
except ValueError:
raise falcon.HTTPBadRequest('Invalid ID',
'ID was not valid.')
params['answer'] = 42
*args: Any additional arguments will be passed to *action* in the
order given, immediately following the *req*, *resp*, *resource*,
and *params* arguments.
**kwargs: Any additional keyword arguments will be passed through to
*action*.
c s� t | tj�rr| � tD ]X}d|�� �zt� ��}W n tyD Y q0 t|�r|f���� �fdd� }|� q� S | }t|����}|S d S )N�on_c s t | � ���}t��|� d S �N)�_wrap_with_before�setattr)� responder�
do_before_all��action�args�kwargs�resource�responder_name� �p/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/falcon/hooks.py�letL s z$before.<locals>._before.<locals>.let) �
isinstance�six�class_typesr �lower�getattr�AttributeError�callabler )�responder_or_resource�methodr r �
do_before_one�r r
r �r r r �_before8 s zbefore.<locals>._beforer )r r
r r r r r �before s #r! c s � ��fdd�}|S )aF Decorator to execute the given action function *after* the responder.
Args:
action (callable): A function of the form
``func(req, resp, resource)``, where `resource` is a
reference to the resource class instance associated with the
request
*args: Any additional arguments will be passed to *action* in the
order given, immediately following the *req*, *resp*, *resource*,
and *params* arguments.
**kwargs: Any additional keyword arguments will be passed through to
*action*.
c s� t | tj�rr| � tD ]X}d|�� �zt� ��}W n tyD Y q0 t|�r|f���� �fdd� }|� q� S | }t|����}|S d S )Nr c s t | � ���}t��|� d S r )�_wrap_with_afterr )r �do_after_allr r r r s z"after.<locals>._after.<locals>.let) r r r r r r r r r"