From: Ben Darnell Date: Thu, 10 Feb 2011 01:01:53 +0000 (-0800) Subject: Undo documentation changes from the introduction of Application.listen(). X-Git-Tag: v1.2.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d42c18c36bb9bd6ff67dc71786cd6ce9332dd31;p=thirdparty%2Ftornado.git Undo documentation changes from the introduction of Application.listen(). The examples given do not work in the 1.1.1 release. This change should be reverted when 1.2 is released and the new examples work. --- diff --git a/website/templates/documentation.txt b/website/templates/documentation.txt index b1a903a39..09b928e57 100644 --- a/website/templates/documentation.txt +++ b/website/templates/documentation.txt @@ -23,6 +23,7 @@ thousands of clients, see Here is the canonical "Hello, world" example app: + import tornado.httpserver import tornado.ioloop import tornado.web @@ -35,7 +36,8 @@ Here is the canonical "Hello, world" example app: ]) if __name__ == "__main__": - application.listen(8888) + http_server = tornado.httpserver.HTTPServer(application) + http_server.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 a409dade2..359e9e2e2 100644 --- a/website/templates/index.html +++ b/website/templates/index.html @@ -26,7 +26,8 @@ sudo python setup.py install

Hello, world

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

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

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