chiark / gitweb /
initial commit
[familyTree.git] / everyPage.py
1 #!/usr/bin/python
2 import cgi  
3 import cgitb
4 import sys
5 import re
6 sys.path.append('/home/naath/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
21         print '<hr>'
22 def footer():
23         print '<hr>'
24         print 'This somewhat silly thing made by '
25         print '<a href=http://www.chiark.greenend.org.uk/~naath>naath</a>'
26         print '<br>'
27         print 'Thanks to <a href=http://www.chiark.greenend.org.uk>chiark</a> for hosting this'
28
29 def title(titleNum):
30         return 'Silly toy'
31
32 def page_header():
33         print 'This is a silly toy for exploring the genealogy of the monarchs of England'
34 def top():
35
36
37         print "Content-Type: text/html;charset=utf-8"
38         print
39
40         conn = askQuestion.connect()
41
42         form = cgi.FieldStorage()
43         return [conn,form]
44
45 def html_start(titleNum):
46         print "<html>"
47         print "<head>"
48         print "<title>"+ title(titleNum) +"</title>"
49         print "</head>"
50         print "<body>"
51         page_header()
52         links()
53
54 def bad():
55         html_start(1)
56         print 'Go Away'
57
58 def good(printMe):
59         html_start(2)
60         print printMe
61
62 def bottom(conn):
63         links() 
64         footer()
65         print "</body>"
66         print "</html>"
67         askQuestion.close(conn)
68