-
Notifications
You must be signed in to change notification settings - Fork 1
/
eithanshavit.py
74 lines (64 loc) · 1.78 KB
/
eithanshavit.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from flask import Flask
from google.appengine.ext.webapp.util import run_wsgi_app
from flask import render_template
from flask import send_from_directory
import os
app = Flask( __name__ )
menu = [
{ "name" : "about",
"link" : "about" },
{ "name" : "websites",
"link" : "websites" },
{ "name" : "apps",
"link" : "apps" },
{ "name" : "hardware",
"link" : "hardware" },
{ "name" : "photography",
"link" : "photography" },
{ "name" : "github",
"link" : "github" },
]
verbalClockImages = {
"final" : [
{ "name" : "vc_front.jpg"},
{ "name" : "vc_frontclose.jpg"},
{ "name" : "vc_frontclose2.jpg"},
],
"hardware" : [
{ "name" : "vc_layout.png"},
{ "name" : "vc_schematics.png"},
{ "name" : "vc_pcb.jpg"},
{ "name" : "vc_assembled.jpg"},
{ "name" : "vc_witharduino.jpg"},
],
"plastic" : [
{ "name" : "vc_wordpanel.jpg"},
{ "name" : "vc_holepanel.jpg"},
{ "name" : "vc_cutout.jpg"},
],
"craft" : [
{ "name" : "vc_leds.jpg"},
{ "name" : "vc_finalback.jpg"},
],
}
@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static'), 'favicon.png' )
@app.route('/hardware.html')
@app.route('/hardware')
def hardware():
return render_template( 'hardware.html', menu=menu, page='hardware',
vcImages=verbalClockImages )
@app.route('/<page>')
def page( page='index' ):
return render_template( page + '.html', menu=menu, page=page )
@app.route('/')
@app.route('/index.html')
def index():
return render_template( 'about.html', menu=menu, page='about' )
@app.errorhandler(404)
@app.errorhandler(500)
def page_not_found(error):
return "Oops, are you in the right place?"
if __name__ == '__main__':
run_wsgi_app(app)