File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/__pycache__/web.cpython-310.pyc
Back
o ;j� � @ s� d Z ddlmZmZmZ ddlZddlZddlZddlZ ddl Z ddlZddlZddl Z ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZ ddlmZ ddlZddlm Z ddlm!Z! ddlm"Z" dd lm#Z# dd lm$Z$ ddlm%Z% ddl&m'Z'm(Z(m)Z) dd lm*Z* ddlm+Z+ ddl,m-Z-m.Z. ddl/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5m6Z6 ddl7m8Z8m9Z9m:Z:m;Z;m<Z< e6Z=e<r�ddl>m?Z@ ddlAmBZC ddlAmDZD nddl@Z@ddlCZCddlEmDZD zddlFZFeFjGeHe:ejIejf ZJW n eK�y Y nw dZL dZM dZN dZO G dd� deP�ZQdd� ZRdd� ZSdd� ZTdd� ZUdd � ZVG d!d"� d"e5�ZWG d#d$� d$e3�ZXG d%d&� d&e#jY�ZZG d'd(� d(e[�Z\G d)d*� d*e[�Z]G d+d,� d,e\�Z^G d-d.� d.eQ�Z_G d/d0� d0eQ�Z`G d1d2� d2eQ�ZaG d3d4� d4eQ�ZbG d5d6� d6eP�ZcG d7d8� d8ec�Zdd9d:� ZeG d;d<� d<eP�ZfG d=d>� d>ef�ZgG d?d@� d@ef�ZhG dAdB� dBef�ZiG dCdD� dDeP�Zjeke dE��r�e jlZmndFdG� Zm d^dHdI�Zne�odJ�ZpdKdL� Zq M d_dNdO�ZrdPdQ� ZsdRdS� ZtdTdU� ZudVdW� ZvdXdY� ZwdZd[� Zxd\d]� ZydS )`a� ``tornado.web`` provides a simple web framework with asynchronous features that allow it to scale to large numbers of open connections, making it ideal for `long polling <http://en.wikipedia.org/wiki/Push_technology#Long_polling>`_. Here is a simple "Hello, world" example app: .. testcode:: import tornado.ioloop import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") if __name__ == "__main__": application = tornado.web.Application([ (r"/", MainHandler), ]) application.listen(8888) tornado.ioloop.IOLoop.current().start() .. testoutput:: :hide: See the :doc:`guide` for additional information. Thread-safety notes ------------------- In general, methods on `RequestHandler` and elsewhere in Tornado are not thread-safe. In particular, methods such as `~RequestHandler.write()`, `~RequestHandler.finish()`, and `~RequestHandler.flush()` must only be called from the main thread. If you use multiple threads it is important to use `.IOLoop.add_callback` to transfer control back to the main thread before finishing the request. � )�absolute_import�division�print_functionN)�isclass)�BytesIO)�Future)�escape)�gen)�httputil)�iostream)�locale)� access_log�app_log�gen_log)� stack_context)�template)�utf8�_unicode)� AnyMatches�DefaultHostMatches�HostMatches�ReversibleRouter�Rule�ReversibleRuleRouter�URLSpec)� ObjectDict�raise_exc_info�unicode_type�_websocket_mask�PY3)� urlencode� � c sX e Zd ZdZdZi Ze�� Ze � d�Z� fdd�Zdd� Z edd � �Zd d� Zdd � Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd�d#d$�Zd%d&� Zd'd(� Zd)d*� Zd+d,� Z e � d-�Z!e � d.�Z"d/d0� Z#e$� Z%e%d1fd2d3�Z&d�d4d5�Z'e%d1fd6d7�Z(d�d8d9�Z)e%d1fd:d;�Z*d�d<d=�Z+d�d>d?�Z,d�d@dA�Z-d�dBdC�Z.edDdE� �Z/d�dFdG�Z0 H "d�dIdJ�Z1d�dKdL�Z2d�dMdN�Z3d�dPdQ�Z4d�dRdS�Z5 T "d�dUdV�Z6d�dWdX�Z7d�dZd[�Z8d\d]� Z9d^d_� Z:d`da� Z;dbdc� Z<ddde� Z=dfdg� Z>dhdi� Z?djdk� Z@dldm� ZAd�dndo�ZBd�dpdq�ZCdrds� ZDd�dudv�ZEdwdx� ZFedydz� �ZGeGjHd{dz� �ZGd|d}� ZId�dd��ZJed�d�� �ZKeKjHd�d�� �ZKd�d�� ZLd�d�� ZMd�d�� ZNed�d�� �ZOd�d�� ZPd�d�� ZQd�d�� ZRd�d�� ZSd�d�d��ZTd�d�d��ZUd�d�� ZVd�d�� ZWd�d�� ZXd�d�� ZYd�d�� ZZe[j\d�d�� �Z]d�d�� Z^d�d�� Z_d�d�� Z`d�d�� Zad�d�� Zbd�d�� Zcd�d�� Zdd�d�� Ze� ZfS )��RequestHandlerz�Base class for HTTP request handlers. Subclasses must define at least one of the methods defined in the "Entry points" section below. )�GET�HEAD�POSTZDELETE�PATCH�PUT�OPTIONSz[\x00-\x08\x0e-\x1f]c s� t t� ��� |� _|� _d� _d� _d� _d � _d � _ d � _ d � _d � _t � fdd�|j�� D ��� _t� |j�� jd<