chiark / gitweb /
Oops, forgot to commit. Lots of faffing arround with graphs, graphs will be added...
[familyTree.git] / cgiFiles / everyPage.py
1 #!/usr/bin/python
2 import cgi  
3 import cgitb
4 import sys
5 import re
6 sys.path.append('/home/naath/familyTreeProject/familyTree')
7 import askQuestion
8 import everyPage
9
10 cgitb.enable()
11 def base_url():
12         return 'http://www.chiark.greenend.org.uk/ucgi/~naath/'
13
14 def links():
15         print '<hr>'
16         print '<a href='+base_url() + 'listPeople.py> list of people</a>'
17         print '<br>'
18         print '<a href='+base_url() + 'listTerr.py> list of territories</a>'
19         print '<br>'
20         print '<a href='+base_url() + 'countNames.py> count how many times first names are use</a>'
21         print '<br>'
22         print '<a href='+base_url()+ 'listAge.py> At what age did people have children</a>'
23         print '<br>'
24         print '<a href='+base_url()+'listAgeDeath.py> At what age did people die</a>'
25         print '<br>'
26         print '<a href = bigGraph.py> big graph</a>'
27
28         print '<hr>'
29 def footer():
30         print '<hr>'
31         print 'This somewhat silly thing made by '
32         print '<a href=http://www.chiark.greenend.org.uk/~naath>naath</a>'
33         print '<br>'
34         print 'Thanks to <a href=http://www.chiark.greenend.org.uk>chiark</a> for hosting this'
35         print '<br>'
36         print 'Information sourced from <a href = en.wikipedia.org> wikipedia</a>'
37         print 'All errors in transcription are mine.'
38         print 'Reports of errors, or ideas of interesting questions to ask'
39         print 'my database by email to naath@chiark.greenend.org.uk'
40         print "(omissions of people are largely because I haven't got to them yet)."
41
42
43
44 def title(titleNum):
45         return 'Silly toy'
46
47 def page_header():
48         print 'This is a silly toy for exploring the genealogy of the monarchs of England'
49 def top():
50
51
52         print "Content-Type: text/html;charset=utf-8"
53         print
54
55         conn = askQuestion.connect()
56
57         form = cgi.FieldStorage()
58         return [conn,form]
59
60 def html_start(titleNum):
61         print "<html>"
62         print "<head>"
63         print "<title>"+ title(titleNum) +"</title>"
64         print "</head>"
65         print "<body>"
66         page_header()
67         links()
68
69 def bad():
70         html_start(1)
71         print 'Go Away'
72
73 def good(printMe):
74         html_start(2)
75         print printMe
76
77 def bottom(conn):
78         links() 
79         footer()
80         print "</body>"
81         print "</html>"
82         askQuestion.close(conn)
83