Skip to content

Commit 6e9edb6

Browse files
committed
started analysis summaries
1 parent 02a643d commit 6e9edb6

File tree

4 files changed

+70
-19
lines changed

4 files changed

+70
-19
lines changed

requirements.txt

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
dj-static==0.0.6
2-
Django==1.8.3
3-
django-crispy-forms==1.4.0
4-
django-leaflet==0.16.0
5-
django-tables2==1.0.4
6-
ecdsa==0.13
7-
Fabric==1.10.2
8-
gunicorn==19.3.0
9-
paramiko==1.15.2
10-
pycrypto==2.6.1
11-
PyFlot==0.2
12-
PyMySQL==0.6.6
13-
six==1.9.0
14-
South==1.0.2
15-
static3==0.6.1
16-
pytz
17-
django-bower
18-
numpy
1+
django
2+
pymysql
3+
bokeh==0.10.0
4+
requests

status/analysis_views.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
from django.shortcuts import render
2+
import requests
3+
4+
def jan_analysis_summary(request):
5+
return analysis_summary(request, 'jan')
6+
7+
8+
def felix_analysis_summary(request):
9+
return analysis_summary(request, 'felix')
10+
11+
12+
def analysis_summary(request, ms_name):
13+
# get latest analysis. need runid and repository
14+
runid, repository = get_latest_analysis(ms_name)
15+
# get summary from github
16+
context = get_summary_context(runid, repository)
17+
18+
return render(request, 'status/analysis_view.html', context)
19+
20+
21+
def get_latest_analysis(ms_name):
22+
runid, repository = '',''
23+
return runid, repository
24+
25+
26+
def get_summary_context(runid, repository, **kw):
27+
j = get_summary_json(runid, repository, **kw)
28+
return j
29+
30+
31+
def get_summary_json(runid, repository,
32+
branch='master',
33+
organization='NMGRLData'):
34+
35+
head, tail = runid[:3], runid[3:]
36+
p = '{}/{}/{}/{}/{}.json'.format(organization, repository,
37+
branch, head, tail)
38+
url = 'https://raw.githubusercontent.com/{}'.format(p)
39+
r = requests.get(url)
40+
return r.json()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% extends "base.html" %}
2+
3+
{% block staticfiles %}
4+
{% load static %}
5+
<link rel="stylesheet" type="text/css" href="{% static 'status/graph.css' %}" />
6+
<link rel="stylesheet" type="text/css" href="{% static 'django_tables2/themes/paleblue/css/screen.css' %}" />
7+
{% endblock %}
8+
9+
10+
{% block body %}
11+
<table>
12+
<tr>
13+
<td>Age</td><td>{{ age }}</td><td>{{ age_error }}</td>
14+
</tr>
15+
</table>
16+
17+
{# auto reload script#}
18+
<script type='text/javascript'>
19+
setTimeout(function(){
20+
window.location.reload(0);
21+
}, 60000);
22+
</script>
23+
24+
{% endblock %}

status/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"""
1616
from django.conf.urls import include, url
1717
from django.contrib import admin
18-
from status import views
18+
from status import views, analysis_views
1919

2020
urlpatterns = [
2121
url(r'^$', views.index, name='status_index'),
@@ -24,6 +24,7 @@
2424
url(r'^arar_graph/$', views.arar_graph, name='arar_graph_index'),
2525
url(r'^jan_status/$', views.jan_status, name='jan_status_index'),
2626
url(r'^felix_status/$', views.felix_status, name='felix_status_index'),
27+
url(r'^jan_analysis_summary', analysis_views.jan_analysis_summary, name='jan_analysis_summary')
2728
#url(r'^(?P<dr>.*)/$', views.graph_view, name='status_graph'),
2829
# url(r'^material/add/$', views.MaterialEntryView.as_view(), name='material_add'),
2930
# url(r'^material/(?P<pk>[0-9]+)/$', views.MaterialView.as_view(), name='material_detail'),

0 commit comments

Comments
 (0)