Download:
child 185:47c8998f49ef
parent 183:c90fd4f23c9e
184:a37007cd39d4
Anton Shestakov <av6@dwimlabs.net>, Wed, 27 Jul 2016 18:39:44 +0800
viewer: shared regular expression for matching project

1 файлов изменено, 4 вставок(+), 3 удалений(-) [+]
viewer.py file | annotate | diff | comparison | revisions
--- a/viewer.py Wed Jul 27 18:05:24 2016 +0800
+++ b/viewer.py Wed Jul 27 18:39:44 2016 +0800
@@ -21,11 +21,12 @@
class CandolintViewer(Application):
def __init__(self):
+ project_re = r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)'
handlers = [
URLSpec(r'/', IndexHandler),
- URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)', ProjectHandler),
- URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)/([\d]+|latest)(?:/(raw))?', CheckHandler),
- URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)/status\.svg', StatusHandler),
+ 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})
]
settings = dict(