chiark / gitweb /
Added search by name
[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 def base_url():
11         return 'http://www.chiark.greenend.org.uk/ucgi/~naath/'
12
13 def links():
14         print '<hr>'
15         print '<a href='+base_url() + 'listPeople.py> list of people</a>'
16         print '<br>'
17         print '<a href='+base_url() + 'listTerr.py> list of territories</a>'
18         print '<br>'
19         print '<a href='+base_url() + 'countNames.py> count how many times first names are use</a>'
20         print '<br>'
21         print '<a href='+base_url()+ 'listAge.py> At what age did people have children</a>'
22
23
24         print '<hr>'
25 def footer():
26         print '<hr>'
27         print 'This somewhat silly thing made by '
28         print '<a href=http://www.chiark.greenend.org.uk/~naath>naath</a>'
29         print '<br>'
30         print 'Thanks to <a href=http://www.chiark.greenend.org.uk>chiark</a> for hosting this'
31
32 def title(titleNum):
33         return 'Silly toy'
34
35 def page_header():
36         print 'This is a silly toy for exploring the genealogy of the monarchs of England'
37 def top():
38
39
40         print "Content-Type: text/html;charset=utf-8"
41         print
42
43         conn = askQuestion.connect()
44
45         form = cgi.FieldStorage()
46         return [conn,form]
47
48 def html_start(titleNum):
49         print "<html>"
50         print "<head>"
51         print "<title>"+ title(titleNum) +"</title>"
52         print "</head>"
53         print "<body>"
54         page_header()
55         links()
56
57 def bad():
58         html_start(1)
59         print 'Go Away'
60
61 def good(printMe):
62         html_start(2)
63         print printMe
64
65 def bottom(conn):
66         links() 
67         footer()
68         print "</body>"
69         print "</html>"
70         askQuestion.close(conn)
71