chiark / gitweb /
Fixed common ancestors to not print the common ancestors twice
authornaath <naath@chiark.greenend.org.uk>
Sun, 6 Apr 2014 20:30:48 +0000 (21:30 +0100)
committernaath <naath@chiark.greenend.org.uk>
Sun, 6 Apr 2014 20:30:48 +0000 (21:30 +0100)
familyTree/askQuestion.py
familyTree/notes

index 7606ab59441bf4708f943fb3669119dba4e981a9..3c1b999930aa1eed2d4482dc7f51c0297c4b0aeb 100755 (executable)
@@ -73,8 +73,14 @@ def print_age_count(row,newLine):
                script = "age.py?age="+str(row[0])
                link = link_Template.substitute(script = \
                        script, text = row[0])
-               return str(row[1]) + ' people had children at age '\
-                        + link + newLine
+               out = str(row[1])
+               if row[1]>1:
+                       out = out + ' people '
+               else:
+                       out = out + ' person '
+
+               out = out + 'had children at age '+ link + newLine
+               return out
        else:
                return print_row(row,newLine)
 
@@ -374,8 +380,10 @@ def all_ancestors(personID,newLine):
                for ancestor in ancestors:
                        id = (ancestor,)
                        for row in run_query(s,id):
-                               thisout = thisout + name_html(row,newLine)+newLine
-                               if row[1] not in allAncestors and is_number(row[1])!=0:
+                               thisout = thisout + \
+                               name_html(row,newLine)+newLine
+                               if row[1] not in allAncestors and \
+                               is_number(row[1])!=0:
                                        newA.append(row[1])
                                        allAncestors.append(row[1])
                                        trackLevel.append(level)
@@ -475,12 +483,12 @@ def common_ancestors(IDA, IDB,newLine):
 
        out = out + ' of ' + name_html([names[0],IDA],newLine)+newLine
 
-       out = out + newLine
-       for b in indexB:
-               t = (common[b],)
-               out = out + print_tagged_query('',s,t,newLine)
-               if b!=indexB[-1]:
-                       out = out + 'and' + newLine
+       #out = out + newLine
+       #for b in indexB:
+       #       t = (common[b],)
+       #       out = out + print_tagged_query('',s,t,newLine)
+       #       if b!=indexB[-1]:
+       #               out = out + 'and' + newLine
 
        out = out + parent_level(bLevels[indexB[0]],'parent')
        if len(indexB)>1:
index eee79691acd0e9a1c22a4a831e07ed740caf8d69..50e1e91c7b31ed3ca0b453fcb95a42addb85a0e6 100644 (file)
@@ -9,7 +9,7 @@ Deal with Consorts, this means including DATES OF MARRIAGE AND DIVORCE
 ELEANOR OF CASTILE has the WRONG PARENTS!!!!
 check others with bad age-at-child numbers
 edmund tudor's birth year is wrong
-
+Kathering Swynford is spelled wrong
 
 territories - some numbers got in there.