core in place

This commit is contained in:
Kenneth Reitz
2012-06-20 06:47:02 -04:00
parent 7ffdcab439
commit a75d530ae3
3 changed files with 31 additions and 4 deletions
+20 -2
View File
@@ -32,12 +32,30 @@ def index():
return render_template('index.html', builds=builds)
@app.route('/<user>/<repo>')
def repo(user, repo):
r = requests.get('http://travis-ci.org/{0}/{1}.json'.format(user, repo))
repo = r.json
_repo = r.json
r = requests.get('http://travis-ci.org/{0}/{1}/builds.json'.format(user, repo))
builds = r.json
return render_template('repo.html', repo=repo, builds=builds)
url = 'http://travis-ci.org/{0}/{1}/builds/{2}.json'.format(
user, repo, _repo[u'last_build_id'])
r = requests.get(url)
build = r.json
return render_template('repo.html', repo=_repo, builds=builds, build=build)
@app.route('/<user>/<repo>/<build>')
def build(user, repo, build):
url = 'http://travis-ci.org/{0}/{1}/builds/{2}.json'.format(user, repo, build)
r = requests.get(url)
build = r.content
return render_template('build.html', build=build)
+5
View File
@@ -1,4 +1,9 @@
{% extends "base.html" %}
{% block content %}
<pre>
{{ build }}
</pre>
{% endblock %}
+6 -2
View File
@@ -2,10 +2,14 @@
{% block content %}
<h2>{{ repo }}</h2>
<h2>{{ repo['slug'] }}</h2>
<pre>
{{ build }}
</pre>
{% for build in builds %}
<li><a href="{{ build['slug'] }}">{{ build['slug'] }}</a></li>
<li><a href="/{{ repo['slug'] }}/{{ build['id'] }}">{{ build['number'] }}</a></li>
{% endfor %}