#!/usr/bin/env python #coding=utf-8 """ demeter web name:main.py author:rabin """ import tornado.ioloop import tornado.httpserver from application import * if __name__ == Demeter.web + ".main": if settings['debug'] == True: application.listen(settings['port']) tornado.ioloop.IOLoop.instance().start() else: server = tornado.httpserver.HTTPServer(application, settings['max_buffer_size']) server.bind(settings['port']) server.start(settings['process']) try: print 'running on port %s' % settings['port'] tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: tornado.ioloop.IOLoop.instance().stop()