mirror of
https://github.com/kennethreitz-archive/travis-light.git
synced 2026-06-05 07:16:12 +00:00
core in place
This commit is contained in:
+20
-2
@@ -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 %}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user