chiark / gitweb /
e1a8d61b7580c628e13f1b58c479d02188572aed
[familyTree.git] / cgiFiles / listAge.py
1 #!/usr/bin/python
2
3 import cgi
4 import cgitb
5 import sys
6 import re
7 sys.path.append('/home/naath/familyTreeProject/familyTree')
8 import askQuestion
9 import everyPage
10
11 [conn,form]=everyPage.top()
12
13 age = form.getvalue('age')
14 if age == None:
15         printMe = askQuestion.count_age_at_child('<br>')
16         if len(printMe)<3:
17                 printMe =  'sorry, no data <br>'
18
19         everyPage.good(printMe)
20
21 else:
22         result = re.match('[-]{0,1}[0-9]{1,4}$', str(age))
23
24         if result == None:
25                 everyPage.bad()
26         else:
27                 printMe  = askQuestion.people_had_child_at_age(age,'<br>')
28                 if len(printMe)<10:
29                         printMe =  'sorry, no data <br>'
30
31                 everyPage.good(printMe)
32
33
34 everyPage.bottom(conn)
35