-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
70 lines (53 loc) · 1.52 KB
/
app.py
File metadata and controls
70 lines (53 loc) · 1.52 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from flask import Flask
from flask_cors import CORS
import psycopg2
import psycopg2.extras
import simplejson as json
from read_data import convert_to_json, read_all_data, read_lv3_data, read_tier7_data, read_non_lv3_data
from check_tool_kit import process_check
from tier7_processor import tier7_processor
from all_ves import process_all_ves
conn = psycopg2.connect(
host="localhost",
database="insta",
user="postgres",
password="admin")
cur = conn.cursor(cursor_factory = psycopg2.extras.RealDictCursor)
all_ves = read_all_data(cur)
lv3_ves = read_lv3_data(cur)
non_lv3_ves = read_non_lv3_data(cur)
tier7_ves = read_tier7_data(cur)
anticheck_lv3_ves = read_lv3_data(cur, remove_fir = True)
anticheck_tier7_ves = read_tier7_data(cur, remove_fir = True)
checked_test_ves = read_tier7_data(cur)
conn.commit()
conn.close()
app = Flask(__name__)
CORS(app)
@app.route("/")
def index():
return "Hello world!"
@app.route("/Scatter")
def scatter():
return process_all_ves(all_ves)
@app.route("/Tier7List")
def tier7_processor():
return tier7_processor(tier7_ves)
@app.route("/CheckToolKit")
def check():
return process_check(anticheck_tier7_ves, lv3_ves)
@app.route("/Gantt")
def statistics():
return process_all_ves(all_ves)
@app.route("/TimeLine")
def timeLine():
return process_all_ves(all_ves)
@app.route("/HistogramMaker")
def histogramMaker():
return process_all_ves(all_ves)
@app.route("/SVG")
def svg():
return process_all_ves(all_ves)
@app.route("/WorldMap")
def world_map():
return process_all_ves(all_ves)