chiark / gitweb /
corrected link to source code
[familyTree.git] / cgiFiles / person.py
1 #!/usr/bin/env python
2 # -*- coding: UTF-8 -*-
3
4 # enable debugging
5 import cgi
6 #import cgitb
7 import sys
8 import re
9 sys.path.append('/home/naath/familyTreeProject/familyTree')
10 import askQuestion
11 import everyPage
12
13 #cgitb.enable()
14
15 [conn,form]=everyPage.top()
16
17 ID = form.getvalue('ID')
18 if ID == None:
19         ID = 1
20 ID = str(ID)
21
22 result = re.match('^[0-9]{1,4}$', str(ID))
23
24 if result == None:
25         everyPage.bad()
26 else:   
27
28         printMe  = askQuestion.person_info(ID,'<br>')
29         if len(printMe)<10:
30                 printMe =  'sorry, no data <br>'
31         else:
32                 url = "<a href= "+everyPage.base_url()\
33                 +"ancestors.py?ID="+str(ID)+">Ancestors</a>"
34                 url2 = "<a href="+everyPage.base_url()\
35                 +"descendants.py?ID="+str(ID)+">Descendants</a>"
36                 printMe = printMe + '<br>' + url+'<br>'+url2
37
38         everyPage.good(printMe)
39         
40 everyPage.bottom()