-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathData.py
More file actions
executable file
·90 lines (64 loc) · 2.09 KB
/
Copy pathData.py
File metadata and controls
executable file
·90 lines (64 loc) · 2.09 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from flask import render_template, Flask, request, redirect
from flaskext.markdown import Markdown
import Spi_Calculator as g
import Data as d
app = Flask(__name__)
Markdown(app)
@app.route("/")
def Home():
return render_template("Home.html")
"""
@app.route('/about')
def About():
f1=open('./ReadMe.md',"r");
mkd_text =f1.read()
return render_template("about.html",mkd_text=mkd_text);
@app.route("/branch")
def Branch():
type='branch'
data_branch=d.Get_Branch_List()
data_sem=d.Get_Branch_Semester_List()
# jsonify(message)
return render_template("SPI.html",type=type,branchlist=data_branch,semlist=data_sem,action='/semester')
@app.route("/semester",methods=['POST'])
def Semester():
Branch=request.values.get("branch")
Semester=request.values.get("semester")
list_sub=d.Get_Branch_Semester_Sub_List(Branch,Semester)
print(list_sub)
type='semester'
return render_template("SPI.html",type=type,branch=Branch,semester=Semester,sublist=list_sub,action='/SPI')
"""
@app.route("/SPI", methods=["POST"])
def SPI():
type = "spi"
# print(request.values.get('branch-sem'))
Branch = request.values.get("branch")
Semester = request.values.get("sem")
Greadlist = request.form.getlist("sublist")
# print(sublist)
# d=request.form.getlist('car2')
# print(Branch,Semester)
list_sub = d.Get_Branch_Semester_Sub_List_SPI(Branch, Semester)
print(list_sub)
a = "Fail"
if "F" not in Greadlist:
a = g.SPI(list_sub, Greadlist)
return render_template("SPI.html", type=type, result=a)
@app.route("/clc")
def Clc():
return render_template("ForAll.html", action="/spi_all")
@app.route("/spi_all", methods=["POST"])
def spi_all():
Greadlist = request.form.getlist("sublist")
Creadit = request.form.getlist("Grade")
print(Greadlist, Creadit)
a = "Fail"
if "F" not in Greadlist:
a = g.SPI(Creadit, Greadlist)
return render_template("SPI.html", type="spi", result=a)
@app.errorhandler(405)
def not_found(e):
# defining function
return redirect("/")
# app.run(debug=True,port=2000)