--- a/viewer.py Wed Jul 27 18:05:24 2016 +0800
+++ b/viewer.py Wed Jul 27 18:39:44 2016 +0800
class CandolintViewer(Application):
+ project_re = r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)'
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})