chiark / gitweb /
graph faffing, now knows who's king
[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 '<ul>'
17         print '<li><a href='+base_url() + \
18         'searchname.py> Search for people</a></li>'
19         print '<li><a href='+base_url() + \
20         'listPeople.py> list of people</a></li>'
21         print '<li><a href='+base_url() + \
22         'listTerr.py> list of territories</a></li>'
23         print '<li><a href='+base_url() + \
24         'countNames.py> first names</a></li>'
25         print '<li><a href='+base_url()+ \
26         'listAge.py> Age at haing child</a></li>'
27         print '<li><a href='+base_url()+\
28         'listAgeDeath.py> Age at death</a></li>'
29         print '<li><a href = bigGraph.py> big graph</a></li>'
30         print '</ul>'
31         print '<hr>'
32 def footer():
33         print '<hr>'
34         print 'This somewhat silly thing made by '
35         print '<a href=http://www.chiark.greenend.org.uk/~naath>naath</a>'
36         print '<br>'
37         print 'Thanks to <a href=http://www.chiark.greenend.org.uk>chiark</a> for hosting this'
38         print '<br>'
39         print 'Information sourced from <a href = en.wikipedia.org> wikipedia</a>'
40         print 'All errors in transcription are mine.'
41         print 'Reports of errors, or ideas of interesting questions to ask'
42         print 'my database by email to naath@chiark.greenend.org.uk'
43         print "(omissions of people are largely because I haven't got to them yet)."
44
45
46
47 def title(titleNum):
48         return 'Silly toy'
49
50 def page_header():
51         print 'This is a silly toy for exploring the genealogy of the monarchs of England'
52 def top():
53
54
55         print "Content-Type: text/html;charset=utf-8"
56         print
57
58         conn = askQuestion.connect()
59
60         form = cgi.FieldStorage()
61         return [conn,form]
62
63 def html_start(titleNum):
64         print "<html>"
65         print "<head>"
66         print "<title>"+ title(titleNum) +"</title>"
67
68         print "<style>"
69         print "ul\n{list-style-type:none;margin:10;padding:0;}"
70         print "li{display:inline;}"
71         print "</style>"
72
73         print "</head>"
74         print "<body>"
75         page_header()
76         links()
77
78 def bad():
79         html_start(1)
80         print 'Go Away'
81
82 def good(printMe):
83         html_start(2)
84         print printMe
85
86 def bottom(conn):
87         links() 
88         footer()
89         print "</body>"
90         print "</html>"
91         askQuestion.close(conn)
92