#!/usr/bin/env python
"""Event Man(ager)

Your friendly manager of attendants at a conference.
"""

import os

import tornado.httpserver
import tornado.ioloop
import tornado.options
from tornado.options import define, options
import tornado.web


class MainHandler(tornado.web.RequestHandler):
    def get(self):
        self.write("Hello, world")


def main():
    define("port", default=5242, help="run on the given port", type=int)
    define("config", help="read configuration file",
            callback=lambda path: tornado.options.parse_config_file(path, final=False))
    define("debug", default=False, help="run in debug mode")
    tornado.options.parse_command_line()

    application = tornado.web.Application([
            (r"/", MainHandler),
        ],
        static_path=os.path.join(os.path.dirname(__file__), "static"),
        debug=options.debug
    )

    http_server = tornado.httpserver.HTTPServer(application)
    http_server.listen(options.port)
    tornado.ioloop.IOLoop.instance().start()


if __name__ == '__main__':
    main()


@@ -238,16 +238,40 @@
 ado.web%0A
+from tornado import gen%0A
 %0A%0Aclass 
@@ -311,16 +311,35 @@
 ndler):%0A
+    @gen.coroutine%0A
     def 
@@ -366,28 +366,42 @@
 elf.
-write(%22Hello, world%22
+redirect('/static/html/index.html'
 )%0A%0A%0A
@@ -789,16 +789,31 @@
     (r%22/
+(?:index.html)?
 %22, MainH
@@ -832,16 +832,92 @@
      %5D,%0A
+        template_path=os.path.join(os.path.dirname(__file__), %22templates%22),%0A
         
@@ -1010,15 +1010,9 @@
 ebug
-%0A    )%0A
+)
 %0A   

handle index.html