-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
54 lines (40 loc) · 1.59 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import flask
import time
from flask import render_template, redirect, url_for, request
from jinja2 import Environment
from jinja2.loaders import FileSystemLoader
import testing_queries
from intermine.webservice import Service
app = flask.Flask(__name__)
@app.route('/testd')
def testd():
service = Service('http://localhost:8080/tools/wormmine/service')
def inner():
for x in dir(testing_queries):
item = getattr(testing_queries, x)
print(item)
if callable(item):
if not item.__name__ in ['assert_result', 'Service', 'assert_greater', 'save_txt_file']:
time.sleep(1)
yield '%s<br/>\n' % item(service, True)
env = Environment(loader=FileSystemLoader('templates'))
tmpl = env.get_template('result.html')
return flask.Response(tmpl.generate(result=inner()))
@app.route('/testp')
def testp():
service = Service('http://intermine.wormbase.org/tools/wormmine/service')
def inner():
for x in dir(testing_queries):
item = getattr(testing_queries, x)
print(item)
if callable(item):
if not item.__name__ in ['assert_result', 'Service', 'assert_greater', 'save_txt_file']:
time.sleep(1)
yield '%s<br/>\n' % item(service)
env = Environment(loader=FileSystemLoader('templates'))
tmpl = env.get_template('result.html')
return flask.Response(tmpl.generate(result=inner()))
@app.route('/')
def index():
return render_template('index.html')
app.run(debug=True, host='0.0.0.0', port='5000')