From 167d26f346319fcc970930842ef68a2e921911fd Mon Sep 17 00:00:00 2001 From: naath Date: Sun, 6 Apr 2014 19:51:24 +0100 Subject: [PATCH] Include offices held in guessing year born --- familyTree/askQuestion.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/familyTree/askQuestion.py b/familyTree/askQuestion.py index 364f088..7606ab5 100755 --- a/familyTree/askQuestion.py +++ b/familyTree/askQuestion.py @@ -216,6 +216,20 @@ def list_people(newLine): 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 "\ @@ -226,7 +240,6 @@ def list_people(newLine): +" and " + str(bornBefore) out = out + newLine - 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 - 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 -- 2.30.2