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