-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
58 lines (49 loc) · 1.58 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
55
56
57
58
import webapp2
import uq
import qut
import gr
from mako.template import Template
from mako.lookup import TemplateLookup
lookup=TemplateLookup(directories=[".","./templates/"])
landing=Template(filename="templates/landing.mako",lookup=lookup)
aboutpage=Template(filename="templates/about.mako",lookup=lookup)
grifwarning=Template(filename="templates/grifwarning.mako",lookup=lookup)
class index(webapp2.RequestHandler):
def get(self):
self.response.write(landing.render(title="No TTCC?",bgcolor="#68a427"))
class about(webapp2.RequestHandler):
def get(self):
self.response.write(aboutpage.render(title="About No TTCC?",bgcolor="#68a427"))
class favicon(webapp2.RequestHandler):
def get(self):
f=open('favicon.ico','rb')
self.response.headers['Content-Type'] ="image/x-icon"
self.response.write(f.read())
f.close()
class loading(webapp2.RequestHandler):
def get(self):
f=open('loading.gif','rb')
self.response.headers['Content-Type'] ="image/gif"
self.response.headers['Cache-Control']="max-age=31536000;"
self.response.write(f.read())
f.close()
class grWarn(webapp2.RequestHandler):
def get(self):
self.response.write(grifwarning.render(title="Griffith | No TTCC?",bgcolor="#D00"))
urls = [
('/', index),
('/about', about),
('/uq',uq.ReqHandler),
('/gr',gr.ReqHandler),
('/gr/warn',grWarn),
('/qut',qut.ReqHandler),
('/qut/ttcc.pdf',qut.Pdf),
('/uq/ttcc.pdf',uq.Pdf),
('/gr/ttcc.pdf',gr.Pdf),
('/favicon.ico',favicon),
('/loading.gif',loading),
]
app=webapp2.WSGIApplication(urls,debug=True)
if __name__=="__main__":
from paste import httpserver
httpserver.serve(app)