--- a/templates/check.html Mon Jul 04 16:35:41 2016 +0800
+++ b/templates/check.html Mon Jul 04 17:12:56 2016 +0800
<dd>{% module Time(check.finished) %}</dd>
<dd>{{ check.get_duration() }}</dd>
+ <dt>Other formats:</dt>
+ <dd><a href="{{ check.get_url() }}/raw">raw</a></dd>
<div class="uk-width-medium-2-3">
--- a/viewer.py Mon Jul 04 16:35:41 2016 +0800
+++ b/viewer.py Mon Jul 04 17:12:56 2016 +0800
class CheckHandler(BaseHandler):
- def get(self, domain, user, name, check_num):
+ def get(self, domain, user, name, check_num, format_='html'):
project = get_project_or_404(domain, user, name)
if check_num == 'latest':
check = get_or_404(Check, project=project)
check = get_or_404(Check, project=project, ordinal=check_num)
lines = json_decode(check.lines)
- self.render('check.html', project=project, check=check, lines=lines)
+ self.set_header('Content-Type', 'text/plain; charset=utf-8')
+ self.write(line['text'])
+ self.render('check.html', project=project, check=check, lines=lines)
class StatusHandler(BaseHandler):
URLSpec(r'/', IndexHandler),
URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)', ProjectHandler),
- URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)/([\d]+|latest)', CheckHandler),
+ URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)/([\d]+|latest)(?:/(raw))?', CheckHandler),
URLSpec(r'/([.a-z0-9_-]+)/([^/]+)/([^/]+)/status\.svg', StatusHandler),
URLSpec(r'.*', ErrorHandler, {'status_code': 404})