├── tornado ├── platform │ ├── __init__.py │ ├── auto.pyi │ ├── windows.py │ ├── epoll.py │ ├── auto.py │ ├── posix.py │ ├── interface.py │ ├── select.py │ ├── caresresolver.py │ └── kqueue.py ├── test │ ├── __init__.py │ ├── templates │ │ └── utf8.html │ ├── static │ │ ├── dir │ │ │ └── index.html │ │ ├── robots.txt │ │ ├── sample.xml.bz2 │ │ ├── sample.xml.gz │ │ └── sample.xml │ ├── csv_translations │ │ └── fr_FR.csv │ ├── options_test.cfg │ ├── static_foo.txt │ ├── gettext_translations │ │ ├── fr_FR │ │ │ └── LC_MESSAGES │ │ │ │ ├── tornado_test.mo │ │ │ │ └── tornado_test.po │ │ └── extract_me.py │ ├── __main__.py │ ├── resolve_test_helper.py │ ├── test.crt │ ├── windows_test.py │ ├── test.key │ ├── import_test.py │ ├── http1connection_test.py │ ├── tcpserver_test.py │ └── util.py ├── speedups.pyi ├── __init__.py └── speedups.c ├── demos ├── facebook │ ├── static │ │ ├── facebook.js │ │ └── facebook.css │ ├── README │ └── templates │ │ ├── stream.html │ │ └── modules │ │ └── post.html ├── blog │ ├── requirements.txt │ ├── templates │ │ ├── entry.html │ │ ├── home.html │ │ ├── create_author.html │ │ ├── login.html │ │ ├── modules │ │ │ └── entry.html │ │ ├── archive.html │ │ ├── base.html │ │ ├── feed.xml │ │ └── compose.html │ ├── docker-compose.yml │ ├── Dockerfile │ ├── schema.sql │ ├── README │ └── static │ │ └── blog.css ├── chat │ ├── templates │ │ ├── message.html │ │ └── index.html │ └── static │ │ └── chat.css ├── websocket │ ├── templates │ │ ├── message.html │ │ └── index.html │ ├── static │ │ ├── chat.css │ │ └── chat.js │ └── chatdemo.py ├── appengine │ ├── templates │ │ ├── entry.html │ │ ├── home.html │ │ ├── modules │ │ │ └── entry.html │ │ ├── archive.html │ │ ├── base.html │ │ ├── feed.xml │ │ └── compose.html │ ├── app.yaml │ ├── README │ └── static │ │ └── blog.css ├── twitter │ └── home.html ├── tcpecho │ ├── README.md │ ├── client.py │ └── server.py ├── benchmark │ ├── gen_benchmark.py │ ├── chunk_benchmark.py │ ├── template_benchmark.py │ ├── stack_context_benchmark.py │ └── benchmark.py ├── helloworld │ └── helloworld.py ├── file_upload │ └── file_receiver.py └── webspider │ └── webspider.py ├── docs ├── requirements.txt ├── favicon.ico ├── tornado.png ├── log.rst ├── utilities.rst ├── http.rst ├── webframework.rst ├── locale.rst ├── routing.rst ├── coroutine.rst ├── networking.rst ├── netutil.rst ├── tcpclient.rst ├── integration.rst ├── tcpserver.rst ├── asyncio.rst ├── http1connection.rst ├── autoreload.rst ├── util.rst ├── stack_context.rst ├── guide.rst ├── httputil.rst ├── httpserver.rst ├── process.rst ├── releases │ ├── v4.4.1.rst │ ├── v1.0.1.rst │ ├── v4.4.3.rst │ ├── v4.5.1.rst │ ├── v4.2.1.rst │ ├── v3.1.1.rst │ ├── v3.0.2.rst │ ├── v2.4.1.rst │ ├── v2.2.1.rst │ ├── v1.2.1.rst │ ├── v4.4.2.rst │ ├── v4.0.2.rst │ ├── v4.0.1.rst │ ├── v1.1.1.rst │ ├── v3.2.2.rst │ ├── v3.0.1.rst │ ├── v2.1.1.rst │ ├── v3.2.1.rst │ ├── v1.1.0.rst │ ├── v1.0.0.rst │ ├── v2.0.0.rst │ ├── v4.4.0.rst │ └── v2.4.0.rst ├── wsgi.rst ├── twisted.rst ├── template.rst ├── queues.rst ├── options.rst ├── caresresolver.rst ├── releases.rst ├── Makefile ├── concurrent.rst ├── testing.rst ├── locks.rst ├── escape.rst ├── websocket.rst ├── guide │ ├── queues.rst │ └── intro.rst ├── auth.rst ├── iostream.rst ├── httpclient.rst ├── ioloop.rst ├── gen.rst └── conf.py ├── maint ├── scripts │ ├── custom_fixers │ │ ├── __init__.py │ │ ├── fix_unicode_literal.py │ │ └── fix_future_imports.py │ ├── run_fixers.py │ ├── run_autopep8.sh │ └── test_resolvers.py ├── test │ ├── websocket │ │ ├── .gitignore │ │ ├── fuzzingserver.json │ │ ├── tox.ini │ │ ├── run-client.sh │ │ ├── fuzzingclient.json │ │ ├── server.py │ │ ├── run-server.sh │ │ └── client.py │ ├── appengine │ │ ├── py27 │ │ │ ├── tornado │ │ │ ├── runtests.py │ │ │ ├── cgi_runtests.py │ │ │ └── app.yaml │ │ ├── setup.py │ │ ├── README │ │ ├── tox.ini │ │ └── common │ │ │ ├── cgi_runtests.py │ │ │ └── runtests.py │ ├── cython │ │ ├── MANIFEST.in │ │ ├── .gitignore │ │ ├── pythonmodule.py │ │ ├── setup.py │ │ ├── tox.ini │ │ ├── cythonapp.pyx │ │ └── cythonapp_test.py │ ├── README │ ├── redbot │ │ ├── tox.ini │ │ └── README │ └── pyuv │ │ └── tox.ini ├── README ├── vm │ ├── ubuntu14.04 │ │ ├── Vagrantfile │ │ ├── setup.sh │ │ └── tox.ini │ ├── shared-setup.sh │ ├── ubuntu12.04 │ │ ├── Vagrantfile │ │ ├── tox.ini │ │ └── setup.sh │ ├── freebsd │ │ ├── setup.sh │ │ ├── tox.ini │ │ └── Vagrantfile │ ├── windows │ │ ├── tox.ini │ │ └── bootstrap.py │ └── README ├── requirements.in ├── requirements.txt └── circlerefs │ └── circlerefs.py ├── codecov.yml ├── .gitignore ├── .coveragerc ├── runtests.sh ├── MANIFEST.in ├── README.rst └── appveyor.yml /tornado/platform/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tornado/test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /demos/facebook/static/facebook.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | Twisted 2 | -------------------------------------------------------------------------------- /maint/scripts/custom_fixers/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tornado/test/templates/utf8.html: -------------------------------------------------------------------------------- 1 | Héllo 2 | -------------------------------------------------------------------------------- /maint/test/websocket/.gitignore: -------------------------------------------------------------------------------- 1 | reports/ 2 | -------------------------------------------------------------------------------- /maint/test/appengine/py27/tornado: -------------------------------------------------------------------------------- 1 | ../../../../tornado -------------------------------------------------------------------------------- /maint/test/appengine/py27/runtests.py: -------------------------------------------------------------------------------- 1 | ../common/runtests.py -------------------------------------------------------------------------------- /maint/test/cython/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include cythonapp.pyx 2 | -------------------------------------------------------------------------------- /tornado/test/static/dir/index.html: -------------------------------------------------------------------------------- 1 | this is the index 2 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: off 2 | coverage: 3 | status: off 4 | -------------------------------------------------------------------------------- /tornado/test/csv_translations/fr_FR.csv: -------------------------------------------------------------------------------- 1 | "school","école" 2 | -------------------------------------------------------------------------------- /maint/test/appengine/py27/cgi_runtests.py: -------------------------------------------------------------------------------- 1 | ../common/cgi_runtests.py -------------------------------------------------------------------------------- /tornado/test/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / 3 | -------------------------------------------------------------------------------- /maint/test/cython/.gitignore: -------------------------------------------------------------------------------- 1 | .eggs 2 | cythonapp.egg-info 3 | dist 4 | -------------------------------------------------------------------------------- /tornado/speedups.pyi: -------------------------------------------------------------------------------- 1 | def websocket_mask(mask: bytes, data: bytes) -> bytes: ... 2 | -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangchuchuan/tornado/master/docs/favicon.ico -------------------------------------------------------------------------------- /docs/tornado.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangchuchuan/tornado/master/docs/tornado.png -------------------------------------------------------------------------------- /demos/blog/requirements.txt: -------------------------------------------------------------------------------- 1 | bcrypt 2 | futures 3 | MySQL-python 4 | markdown 5 | tornado 6 | torndb 7 | -------------------------------------------------------------------------------- /tornado/test/options_test.cfg: -------------------------------------------------------------------------------- 1 | port=443 2 | port=443 3 | username='李康' 4 | 5 | foo_bar='a' 6 | 7 | my_path = __file__ 8 | -------------------------------------------------------------------------------- /demos/chat/templates/message.html: -------------------------------------------------------------------------------- 1 |
2 | -------------------------------------------------------------------------------- /tornado/test/static/sample.xml.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangchuchuan/tornado/master/tornado/test/static/sample.xml.bz2 -------------------------------------------------------------------------------- /tornado/test/static/sample.xml.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangchuchuan/tornado/master/tornado/test/static/sample.xml.gz -------------------------------------------------------------------------------- /demos/blog/templates/entry.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block body %} 4 | {% module Entry(entry) %} 5 | {% end %} 6 | -------------------------------------------------------------------------------- /demos/websocket/templates/message.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /tornado/test/static_foo.txt: -------------------------------------------------------------------------------- 1 | This file should not be served by StaticFileHandler even though 2 | its name starts with "static". 3 | -------------------------------------------------------------------------------- /demos/appengine/templates/entry.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block body %} 4 | {% module Entry(entry) %} 5 | {% end %} 6 | -------------------------------------------------------------------------------- /docs/log.rst: -------------------------------------------------------------------------------- 1 | ``tornado.log`` --- Logging support 2 | =================================== 3 | 4 | .. automodule:: tornado.log 5 | :members: 6 | -------------------------------------------------------------------------------- /maint/test/cython/pythonmodule.py: -------------------------------------------------------------------------------- 1 | from tornado import gen 2 | 3 | @gen.coroutine 4 | def hello(): 5 | yield gen.sleep(0.001) 6 | raise gen.Return("hello") 7 | -------------------------------------------------------------------------------- /docs/utilities.rst: -------------------------------------------------------------------------------- 1 | Utilities 2 | ========= 3 | 4 | .. toctree:: 5 | 6 | autoreload 7 | log 8 | options 9 | stack_context 10 | testing 11 | util 12 | -------------------------------------------------------------------------------- /docs/http.rst: -------------------------------------------------------------------------------- 1 | HTTP servers and clients 2 | ======================== 3 | 4 | .. toctree:: 5 | 6 | httpserver 7 | httpclient 8 | httputil 9 | http1connection 10 | -------------------------------------------------------------------------------- /docs/webframework.rst: -------------------------------------------------------------------------------- 1 | Web framework 2 | ============= 3 | 4 | .. toctree:: 5 | 6 | web 7 | template 8 | routing 9 | escape 10 | locale 11 | websocket 12 | -------------------------------------------------------------------------------- /tornado/platform/auto.pyi: -------------------------------------------------------------------------------- 1 | # auto.py is full of patterns mypy doesn't like, so for type checking 2 | # purposes we replace it with interface.py. 3 | 4 | from .interface import * 5 | -------------------------------------------------------------------------------- /docs/locale.rst: -------------------------------------------------------------------------------- 1 | ``tornado.locale`` --- Internationalization support 2 | =================================================== 3 | 4 | .. automodule:: tornado.locale 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/routing.rst: -------------------------------------------------------------------------------- 1 | ``tornado.routing`` --- Basic routing implementation 2 | ==================================================== 3 | 4 | .. automodule:: tornado.routing 5 | :members: 6 | -------------------------------------------------------------------------------- /maint/README: -------------------------------------------------------------------------------- 1 | This directory contains tools and scripts that are used in the development 2 | and maintainance of Tornado itself, but are probably not of interest to 3 | Tornado users. 4 | -------------------------------------------------------------------------------- /docs/coroutine.rst: -------------------------------------------------------------------------------- 1 | Coroutines and concurrency 2 | ========================== 3 | 4 | .. toctree:: 5 | 6 | gen 7 | concurrent 8 | locks 9 | queues 10 | process 11 | -------------------------------------------------------------------------------- /docs/networking.rst: -------------------------------------------------------------------------------- 1 | Asynchronous networking 2 | ======================= 3 | 4 | .. toctree:: 5 | 6 | ioloop 7 | iostream 8 | netutil 9 | tcpclient 10 | tcpserver 11 | -------------------------------------------------------------------------------- /tornado/test/gettext_translations/fr_FR/LC_MESSAGES/tornado_test.mo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/huangchuchuan/tornado/master/tornado/test/gettext_translations/fr_FR/LC_MESSAGES/tornado_test.mo -------------------------------------------------------------------------------- /docs/netutil.rst: -------------------------------------------------------------------------------- 1 | ``tornado.netutil`` --- Miscellaneous network utilities 2 | ======================================================= 3 | 4 | .. automodule:: tornado.netutil 5 | :members: 6 | -------------------------------------------------------------------------------- /maint/test/appengine/setup.py: -------------------------------------------------------------------------------- 1 | # Dummy setup file to make tox happy. In the appengine world things aren't 2 | # installed through setup.py 3 | import distutils.core 4 | distutils.core.setup() 5 | -------------------------------------------------------------------------------- /docs/tcpclient.rst: -------------------------------------------------------------------------------- 1 | ``tornado.tcpclient`` --- `.IOStream` connection factory 2 | ======================================================== 3 | 4 | .. automodule:: tornado.tcpclient 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/integration.rst: -------------------------------------------------------------------------------- 1 | Integration with other services 2 | =============================== 3 | 4 | .. toctree:: 5 | 6 | auth 7 | wsgi 8 | asyncio 9 | caresresolver 10 | twisted 11 | -------------------------------------------------------------------------------- /docs/tcpserver.rst: -------------------------------------------------------------------------------- 1 | ``tornado.tcpserver`` --- Basic `.IOStream`-based TCP server 2 | ============================================================ 3 | 4 | .. automodule:: tornado.tcpserver 5 | :members: 6 | -------------------------------------------------------------------------------- /maint/test/appengine/py27/app.yaml: -------------------------------------------------------------------------------- 1 | application: tornado-tests-appengine27 2 | version: 1 3 | runtime: python27 4 | threadsafe: false 5 | api_version: 1 6 | 7 | handlers: 8 | - url: / 9 | script: cgi_runtests.py -------------------------------------------------------------------------------- /maint/test/README: -------------------------------------------------------------------------------- 1 | This directory contains additional tests that are not included in the main 2 | suite (because e.g. they have extra dependencies, run slowly, or produce 3 | more output than a simple pass/fail) 4 | -------------------------------------------------------------------------------- /maint/scripts/run_fixers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Usage is like 2to3: 3 | # $ maint/scripts/run_fixers.py -wn --no-diffs tornado 4 | 5 | import sys 6 | from lib2to3.main import main 7 | 8 | sys.exit(main("custom_fixers")) 9 | -------------------------------------------------------------------------------- /docs/asyncio.rst: -------------------------------------------------------------------------------- 1 | ``tornado.platform.asyncio`` --- Bridge between ``asyncio`` and Tornado 2 | ======================================================================= 3 | 4 | .. automodule:: tornado.platform.asyncio 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/http1connection.rst: -------------------------------------------------------------------------------- 1 | ``tornado.http1connection`` -- HTTP/1.x client/server implementation 2 | ==================================================================== 3 | 4 | .. automodule:: tornado.http1connection 5 | :members: 6 | -------------------------------------------------------------------------------- /demos/blog/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block body %} 4 | {% for entry in entries %} 5 | {% module Entry(entry) %} 6 | {% end %} 7 | 8 | {% end %} 9 | -------------------------------------------------------------------------------- /docs/autoreload.rst: -------------------------------------------------------------------------------- 1 | ``tornado.autoreload`` --- Automatically detect code changes in development 2 | =========================================================================== 3 | 4 | .. automodule:: tornado.autoreload 5 | :members: 6 | -------------------------------------------------------------------------------- /demos/appengine/templates/home.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block body %} 4 | {% for entry in entries %} 5 | {% module Entry(entry) %} 6 | {% end %} 7 | 8 | {% end %} 9 | -------------------------------------------------------------------------------- /docs/util.rst: -------------------------------------------------------------------------------- 1 | ``tornado.util`` --- General-purpose utilities 2 | ============================================== 3 | 4 | .. testsetup:: 5 | 6 | from tornado.util import * 7 | 8 | .. automodule:: tornado.util 9 | :members: 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *.pyo 3 | *.so 4 | *.class 5 | *~ 6 | build/ 7 | /dist/ 8 | MANIFEST 9 | /tornado.egg-info/ 10 | .tox/ 11 | .vagrant 12 | /.coverage 13 | /htmlcov/ 14 | /env/ 15 | # Used in demo apps 16 | secrets.cfg 17 | .mypy_cache/ 18 | -------------------------------------------------------------------------------- /docs/stack_context.rst: -------------------------------------------------------------------------------- 1 | ``tornado.stack_context`` --- Exception handling across asynchronous callbacks 2 | ============================================================================== 3 | 4 | .. automodule:: tornado.stack_context 5 | :members: 6 | -------------------------------------------------------------------------------- /demos/appengine/app.yaml: -------------------------------------------------------------------------------- 1 | application: tornado-appengine 2 | version: 2 3 | runtime: python27 4 | api_version: 1 5 | threadsafe: yes 6 | 7 | handlers: 8 | - url: /static/ 9 | static_dir: static 10 | 11 | - url: /.* 12 | script: blog.application 13 | -------------------------------------------------------------------------------- /docs/guide.rst: -------------------------------------------------------------------------------- 1 | User's guide 2 | ============ 3 | 4 | .. toctree:: 5 | 6 | guide/intro 7 | guide/async 8 | guide/coroutines 9 | guide/queues 10 | guide/structure 11 | guide/templates 12 | guide/security 13 | guide/running 14 | -------------------------------------------------------------------------------- /docs/httputil.rst: -------------------------------------------------------------------------------- 1 | ``tornado.httputil`` --- Manipulate HTTP headers and URLs 2 | ========================================================= 3 | 4 | .. testsetup:: 5 | 6 | from tornado.httputil import * 7 | 8 | .. automodule:: tornado.httputil 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/httpserver.rst: -------------------------------------------------------------------------------- 1 | ``tornado.httpserver`` --- Non-blocking HTTP server 2 | =================================================== 3 | 4 | .. automodule:: tornado.httpserver 5 | 6 | HTTP Server 7 | ----------- 8 | .. autoclass:: HTTPServer 9 | :members: 10 | -------------------------------------------------------------------------------- /maint/test/redbot/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py27 3 | setupdir=../../.. 4 | 5 | [testenv] 6 | commands = python red_test.py 7 | deps = 8 | # Newer versions of thor have a bug with redbot (5/18/13) 9 | thor==0.2.0 10 | git+https://github.com/mnot/redbot.git 11 | -------------------------------------------------------------------------------- /maint/vm/ubuntu14.04/Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant::Config.run do |config| 2 | config.vm.box = "ubuntu/trusty64" 3 | 4 | config.vm.network :hostonly, "172.19.1.8" 5 | config.vm.share_folder("tornado", "/tornado", "../../..", :nfs=> true) 6 | 7 | config.vm.provision :shell, :path => "setup.sh" 8 | end -------------------------------------------------------------------------------- /docs/process.rst: -------------------------------------------------------------------------------- 1 | ``tornado.process`` --- Utilities for multiple processes 2 | ======================================================== 3 | 4 | .. automodule:: tornado.process 5 | :members: 6 | 7 | .. exception:: CalledProcessError 8 | 9 | An alias for `subprocess.CalledProcessError`. 10 | -------------------------------------------------------------------------------- /demos/twitter/home.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |6 | {% end %} 7 | 8 |
14 | {% end %} 15 | -------------------------------------------------------------------------------- /demos/blog/templates/modules/entry.html: -------------------------------------------------------------------------------- 1 || {{ cell }} | 45 | {% end %} 46 |