File: //usr/lib/python3/dist-packages/mercurial/hgweb/__pycache__/webcommands.cpython-310.pyc
o
�]Lb
� � @ sN d dl mZ d dlZd dlZd dlZd dlZddlmZ ddlm Z m
Z
ddlmZ ddl
mZmZmZmZmZmZ dd lmZmZmZmZmZmZmZmZmZmZmZ dd
lm Z ddlm!Z! g Z"i Z#G dd
� d
e$�Z%e%d�dd� �Z&e%d�dd� �Z'dd� Z(e%d�dd� �Z)dd� Z*e%d�dRdd��Z+e%d�d d!� �Z,e%d"�d#d$� �Z-e%d%�e-�Z.d&d'� Z/e%d(�d)d*� �Z0e%d+�d,d-� �Z1e%d.�d/d0� �Z2e%d1�d2d3� �Z3e%d4�d5d6� �Z4e%d7�d8d9� �Z5e%d:�e5�Z6e%d;�d<d=� �Z7e%d>�d?d@� �Z8e%dA�dBdC� �Z9e%dD�dEdF� �Z:e%dG�dHdI� �Z;e%dJ�dKdL� �Z<dMdN� Z=e%dO�dPdQ� �Z>e#�?� Z@dS )S� )�absolute_importN� )�_)�hex�short��getattr� )�
ErrorResponse�HTTP_FORBIDDEN�HTTP_NOT_FOUND�get_contact� paritygen�
staticfile)�archival�dagop�encoding�error�graphmod�pycompat�revset�
revsetlang�scmutil�smartset�templateutil)�
stringutil)�webutilc @ s e Zd ZdZdd� Zdd� ZdS )�
webcommanda� Decorator used to register a web command handler.
The decorator takes as its positional arguments the name/path the
command should be accessible under.
When called, functions receive as arguments a ``requestcontext``,
``wsgirequest``, and a templater instance for generatoring output.
The functions should populate the ``rctx.res`` object with details
about the HTTP response.
The function returns a generator to be consumed by the WSGI application.
For most commands, this should be the result from
``web.res.sendresponse()``. Many commands will call ``web.sendtemplate()``
to render a template.
Usage:
@webcommand('mycommand')
def mycommand(web):
pass
c C s
|| _ d S �N��name)�selfr � r"