File: //opt/saltstack/salt/lib/python3.10/site-packages/tornado/__pycache__/web.cpython-310.pyc
o
;jPA � @ s d Z ddlZddlZddlZddlZddlZddlZddlZddl Z ddl
Zddlm
Z
ddlmZ ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZ ddl m!Z!m"Z" ddlm#Z# ddlm$Z$ dd l%m&Z& dd
lm'Z' ddlm(Z( ddlm)Z) dd
l*m+Z+m,Z,m-Z- ddlm.Z. ddl/m0Z0m1Z1 ddl2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z: ddl;m<Z<m=Z=m>Z> e9Z?ddl@mAZAmBZBmCZCmDZDmEZEmFZFmGZGmHZHmIZImJZJmKZKmLZLmMZMmNZN ddlmOZO ddl@Z@e@jP�rddl@mQZQ eCeRe=eSejTejf ZUeCeVeReAeSeVf eAeSeRf f ZWdZX dZY dZZ dZ[ G dd� d�Z\e\� Z]G dd� d�Z^eLde^d�Z_deKe_ deKe_ fdd �Z`deKe^ deafd!d"�Zbd#eHd$eDeEd f deHd$eDeEd f fd%d&�Zcd#eHd$eDeEd f deHd$eDeEd f fd'd(�ZdG d)d*� d*e8�ZeG d+d,� d,e6�ZfG d-d.� d.e'jg�ZhG d/d0� d0ei�ZjG d1d2� d2ei�ZkG d3d4� d4ej�ZlG d5d6� d6e^�ZmG d7d8� d8e^�ZnG d9d:� d:e^�ZoG d;d<� d<e^�ZpG d=d>� d>�ZqG d?d@� d@eq�Zrd#eHd$eDeEd f deHd$eDeEd f fdAdB�ZsG dCdD� dD�ZtG dEdF� dFet�ZuG dGdH� dHet�ZvG dIdJ� dJet�ZwG dKdL� dL�Zx dndMeWdNeVdOeCeVeRf dPeDeS dQeDeHg eyf dReDeS deRfdSdT�Zze�{dU�Z|dOeRdeSfdVdW�Z} X dodMeWdNeVdOeCdeVeRf dYeydQeDeHg eyf dZeDeS deDeR fd[d\�Z~dMeCeVeRf dNeVdOeRdYeydQeHg eyf deDeR fd]d^�ZdOeRdeFeSeReReReRf fd_d`�Z�dMeWdNeVdOeRdYeydQeHg eyf deDeR fdadb�Z�dOeCeVeRf deDeS fdcdd�Z�dMeCeVeRf deeCeVeRf deRfdfdg�Z�dMeCeVeRf dheRdeRfdidj�Z�dkeVdeafdldm�Z�dS )pa4 ``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 asyncio
import tornado
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
async def main():
application = tornado.web.Application([
(r"/", MainHandler),
])
application.listen(8888)
await asyncio.Event().wait()
if __name__ == "__main__":
asyncio.run(main())
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, or to limit your use of other threads to
`.IOLoop.run_in_executor` and ensure that your callbacks running in
the executor do not refer to Tornado objects.
� N)�isclass)�BytesIO)� urlencode)�Future�"future_set_result_unless_cancelled)�escape)�gen)�
HTTPServer)�httputil)�iostream)�locale)�
access_log�app_log�gen_log)�template)�utf8�_unicode)�
AnyMatches�DefaultHostMatches�HostMatches�ReversibleRouter�Rule�ReversibleRuleRouter�URLSpec� _RuleList)�
ObjectDict�unicode_type�_websocket_mask)�Dict�Any�Union�Optional� Awaitable�Tuple�List�Callable�Iterable� Generator�Type�TypeVar�cast�overload)�
TracebackType)�Set� � c @ s e Zd ZdS )�_ArgDefaultMarkerN)�__name__�
__module__�__qualname__� r4 r4 �?/opt/saltstack/salt/lib/python3.10/site-packages/tornado/web.pyr0 � s r0 c s� e Zd ZU dZdZeedf ed<