Download:
child 186:75bb524e7660
parent 184:a37007cd39d4
185:47c8998f49ef
Anton Shestakov <av6@dwimlabs.net>, Wed, 27 Jul 2016 18:43:12 +0800
viewer: using tuples for describing handlers is easier (Especially true since Tornado 3.2)

1 файлов изменено, 6 вставок(+), 6 удалений(-) [+]
viewer.py file | annotate | diff | comparison | revisions
--- a/viewer.py Wed Jul 27 18:39:44 2016 +0800
+++ b/viewer.py Wed Jul 27 18:43:12 2016 +0800
@@ -5,7 +5,7 @@
from tornado.ioloop import IOLoop
from tornado.options import define, options
-from tornado.web import Application, URLSpec
+from tornado.web import Application
from candolint import uimodules
from candolint.handlers import IndexHandler, ProjectHandler, CheckHandler, StatusHandler, ErrorHandler
@@ -23,11 +23,11 @@
def __init__(self):
project_re = r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)'
handlers = [
- URLSpec(r'/', IndexHandler),
- URLSpec(project_re, ProjectHandler),
- URLSpec(project_re + r'/([\d]+|latest)(?:/(raw))?', CheckHandler),
- URLSpec(project_re + r'/status\.svg', StatusHandler),
- URLSpec(r'.*', ErrorHandler, {'status_code': 404})
+ (r'/', IndexHandler),
+ (project_re, ProjectHandler),
+ (project_re + r'/([\d]+|latest)(?:/(raw))?', CheckHandler),
+ (project_re + r'/status\.svg', StatusHandler),
+ (r'.*', ErrorHandler, {'status_code': 404})
]
settings = dict(
static_path=rel('static'),