chiark
/
gitweb
/
~naath
/
familyTree.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8a3540
)
Include offices held in guessing year born
author
naath
<naath@chiark.greenend.org.uk>
Sun, 6 Apr 2014 18:51:24 +0000
(19:51 +0100)
committer
naath
<naath@chiark.greenend.org.uk>
Sun, 6 Apr 2014 18:51:24 +0000
(19:51 +0100)
familyTree/askQuestion.py
patch
|
blob
|
history
diff --git
a/familyTree/askQuestion.py
b/familyTree/askQuestion.py
index 364f08888f0e1cdf4e1050b36bc298f70ad660dd..7606ab59441bf4708f943fb3669119dba4e981a9 100755
(executable)
--- a/
familyTree/askQuestion.py
+++ b/
familyTree/askQuestion.py
@@
-216,6
+216,20
@@
def list_people(newLine):
if bornAfter==0:
bornAfter = hadChild[0]-100
if bornAfter==0:
bornAfter = hadChild[0]-100
+ u = "Select styles.startYear, styles.style from"\
+ +" people INNER JOIN styles"\
+ +" ON people.ID = styles.ID"\
+ +" WHERE people.ID = ? and"\
+ +" styles.startYear <>0"\
+ +" ORDER BY styles.startYear;"
+
+ for r in run_query(u,t):
+ out = out + r[1] + " from " + str(r[0])\
+ + newLine
+ if bornAfter ==0:
+ bornAfter = r[0] -100
+ break
+
if bornAfter!=0:
if bornBefore == 0:
out = out + "probably born "\
if bornAfter!=0:
if bornBefore == 0:
out = out + "probably born "\
@@
-226,7
+240,6
@@
def list_people(newLine):
+" and " + str(bornBefore)
out = out + newLine
+" and " + str(bornBefore)
out = out + newLine
-
year = row[2]
return out
year = row[2]
return out
@@
-660,8
+673,9
@@
def person_info(personID,newLine):
output = output + print_tagged_name('With',r,newLine)
#age when child born
output = output + print_tagged_name('With',r,newLine)
#age when child born
- age = row[2]-bornYear
- output = output[:-4] + " at the age of "+str(age) + newLine
+ if row[2] !=0 and bornYear != 0:
+ age = row[2]-bornYear
+ output = output[:-4] + " at the age of "+str(age) + newLine
output = output + newLine
output = output + newLine