-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathstart.py
executable file
·36 lines (27 loc) · 915 Bytes
/
start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# coding: utf-8
import logging
import tornado.web
import tornado.httpserver
import tornado.ioloop
from tornado.log import access_log
from config import conf
import route
class Application(tornado.web.Application):
def __init__(self):
if conf.SETTINGS.get('access_log'):
access_log.setLevel(logging.INFO)
tornado.web.Application.__init__(self, route.route, **conf.SETTINGS)
def main():
print """
____ _ __ __
/ __ \___ ____ _(_)____/ /____ ________ ____/ /
/ /_/ / _ \/ __ `/ / ___/ __/ _ \/ ___/ _ \/ __ /
/ _, _/ __/ /_/ / (__ ) /_/ __/ / / __/ /_/ /
/_/ |_|\___/\__, /_/____/\__/\___/_/ \___/\__,_/ v0.2.1
/____/
"""
server = tornado.httpserver.HTTPServer(Application())
server.listen(conf.PORT, conf.HOST)
tornado.ioloop.IOLoop.instance().start()
if __name__ == '__main__':
main()