From: Ben Darnell Date: Wed, 16 Feb 2011 19:52:06 +0000 (-0800) Subject: Revert "Undo documentation changes from the introduction of Application.listen()." X-Git-Tag: v1.2.0~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b8500d3cc08dd4527b0363b2ede4ea6758713b38;p=thirdparty%2Ftornado.git Revert "Undo documentation changes from the introduction of Application.listen()." This reverts commit 2d42c18c36bb9bd6ff67dc71786cd6ce9332dd31. --- diff --git a/website/templates/documentation.txt b/website/templates/documentation.txt index 09b928e57..b1a903a39 100644 --- a/website/templates/documentation.txt +++ b/website/templates/documentation.txt @@ -23,7 +23,6 @@ thousands of clients, see Here is the canonical "Hello, world" example app: - import tornado.httpserver import tornado.ioloop import tornado.web @@ -36,8 +35,7 @@ Here is the canonical "Hello, world" example app: ]) if __name__ == "__main__": - http_server = tornado.httpserver.HTTPServer(application) - http_server.listen(8888) + application.listen(8888) tornado.ioloop.IOLoop.instance().start() See [Tornado walkthrough](#tornado-walkthrough) below for a detailed diff --git a/website/templates/index.html b/website/templates/index.html index 359e9e2e2..a409dade2 100644 --- a/website/templates/index.html +++ b/website/templates/index.html @@ -26,8 +26,7 @@ sudo python setup.py install

Hello, world

Here is the canonical "Hello, world" example app for Tornado:

-
import tornado.httpserver
-import tornado.ioloop
+  
import tornado.ioloop
 import tornado.web
 
 class MainHandler(tornado.web.RequestHandler):
@@ -39,8 +38,7 @@ application = tornado.web.Application([
 ])
 
 if __name__ == "__main__":
-    http_server = tornado.httpserver.HTTPServer(application)
-    http_server.listen(8888)
+    application.listen(8888)
     tornado.ioloop.IOLoop.instance().start()

See the Tornado documentation for a detailed walkthrough of the framework.