7 sys.path.append('/home/naath/familyTreeProject/familyTree')
9 from random import randrange
14 return 'http://www.chiark.greenend.org.uk/ucgi/~naath/'
16 def make_list(script,text):
18 if text == 'Random person':
19 npeople = askQuestion.number_people()
20 script+='?ID=%d' %(randrange(npeople))
22 if script[:4]=='http':
23 pageText+= '<li><a href=%s>%s</a></li>\n' %(script,text)
25 pageText+= '<li><a href = %s%s>%s</a></li>\n' %(base_url(),script,text)
30 items.append(('searchname.py','Search for people'))
31 items.append(('listPeople.py','List of people'))
32 items.append(('listTerr.py','List of territories'))
33 items.append(('listFam.py','List of families'))
34 items.append(('http://www.chiark.greenend.org.uk/~naath/bigGraph.png',\
36 items.append(('countNames.py','First name'))
37 items.append(('listAge.py','Age at having child'))
38 items.append(('listAgeDeath.py','Age at death'))
39 items.append(('listChildCount.py','Number of children'))
40 items.append(('birthday.py','Birthday calendar'))
41 items.append(('person.py','Random person'))
42 items.append(('aliveOn.py','Alive on date'))
44 'http://www.chiark.greenend.org.uk/~naath/spouses-related.html'\
47 http://www.chiark.greenend.org.uk/ucgi/~naath/git/familyTree.git'\
50 for i in range(len(items)):
52 if i%4==0 and i!=len(items):
56 make_list(item[0],item[1])
66 pageText+= 'This somewhat silly thing made by \n'
67 pageText+= '<a href=http://www.chiark.greenend.org.uk/~naath>naath</a>\n'
69 pageText+= 'Thanks to <a href=http://www.chiark.greenend.org.uk>chiark</a> for hosting this\n'
71 pageText+= 'Information sourced from <a href = en.wikipedia.org> wikipedia</a>\n'
72 pageText+= 'All errors in transcription are mine.\n'
73 pageText+= 'Reports of errors, or ideas of interesting questions to ask\n'
74 pageText+= 'my database by email to naath@chiark.greenend.org.uk\n'
75 pageText+= "(omissions of people are largely because I haven't got to them yet).\n"
84 pageText+= 'This is a silly toy for exploring the genealogy of the monarchs of England'
89 pageText= "Content-Type: text/html;charset=utf-8\n"
92 conn = askQuestion.connect()
94 form = cgi.FieldStorage()
97 def html_start(titleNum):
100 pageText+='<meta charset="UTF-8" />\n'
101 pageText+= "<head>\n"
102 pageText+= "<title>"+ title(titleNum) +"</title>\n"
104 pageText+= "<style>\n"
105 pageText+= "ul\n{list-style-type:none;margin:10;padding:0;}\n"
106 pageText+= "li{display:inline;}\n"
107 pageText+= "</style>\n"
108 pageText+= '<script type="text/javascript"'
109 #myScript = '"/home/naath/public-html/sorttable.js"'
110 myScript = 'http://www.chiark.greenend.org.uk/~naath/sorttable.js'
111 pageText+= ' src='+myScript+'></script>'
114 pageText+= "</head>\n"
115 pageText+= "<body>\n"
122 pageText+= 'Go Away\n'
133 pageText+= "</body>\n"
134 pageText+= "</html>\n"
141 print pageText.encode('utf-8')
145 pageText = pageText[39:]
147 f = codecs.open(file,mode = 'w',encoding = 'utf-8')