Permalink
Browse files

core in place

  • Loading branch information...
1 parent 7ffdcab commit a75d530ae35e2d5fda778ecbbb612d7b616e11b4 @kennethreitz committed Jun 20, 2012
Showing with 31 additions and 4 deletions.
  1. +20 −2 splenda/core.py
  2. +5 −0 splenda/templates/build.html
  3. +6 −2 splenda/templates/repo.html
View
@@ -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)
+
@@ -1,4 +1,9 @@
{% extends "base.html" %}
{% block content %}
+
+<pre>
+{{ build }}
+</pre>
+
{% endblock %}
@@ -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 %}

0 comments on commit a75d530

Please sign in to comment.