]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Add address parameter to Application.listen to match HTTPServer.listen
authorBen Darnell <ben@bendarnell.com>
Wed, 17 Nov 2010 00:30:51 +0000 (16:30 -0800)
committerBen Darnell <ben@bendarnell.com>
Wed, 17 Nov 2010 00:30:51 +0000 (16:30 -0800)
tornado/web.py

index beb1457c131446be78f94c511938aafc620c801d..dd08dddb6542675d2ab9c929adf39ad91f46101d 100644 (file)
@@ -1027,14 +1027,15 @@ class Application(object):
             import autoreload
             autoreload.start()
 
-    def listen(self, port, **kwargs):
+    def listen(self, port, address="", **kwargs):
         """Starts an HTTP server for this application on the given port.
 
         This is a convenience alias for creating an HTTPServer object
-        and calling its listen method.  Keyword arguments are passed to
-        the HTTPServer constructor.  For advanced uses (e.g. preforking),
-        do not use this method; create an HTTPServer and call its
-        bind/start methods directly.
+        and calling its listen method.  Keyword arguments not
+        supported by HTTPServer.listen are passed to the HTTPServer
+        constructor.  For advanced uses (e.g. preforking), do not use
+        this method; create an HTTPServer and call its bind/start
+        methods directly.
 
         Note that after calling this method you still need to call
         IOLoop.instance().start() to start the server.
@@ -1043,7 +1044,7 @@ class Application(object):
         # is not importable on appengine
         from tornado.httpserver import HTTPServer
         server = HTTPServer(self, **kwargs)
-        server.listen(port)
+        server.listen(port, address)
 
     def add_handlers(self, host_pattern, host_handlers):
         """Appends the given handlers to our handler list.