chiark / gitweb /
removed trailing great^n grand parent line from ancestor description
authornaath <naath@chiark.greenend.org.uk>
Sun, 30 Mar 2014 12:49:12 +0000 (13:49 +0100)
committernaath <naath@chiark.greenend.org.uk>
Sun, 30 Mar 2014 12:49:12 +0000 (13:49 +0100)
familyTree/askQuestion.py

index 70185030007dc948a29a9ea04122e5eb9e8bb9dc..e707f64717d840a6bb7dd1be823633509b5b79a0 100755 (executable)
@@ -159,16 +159,18 @@ def all_ancestors(personID,newLine):
        while len(ancestors)>0:
                level = level+1
                newA =[]
-               out = out+newLine + parent_level(level,'parent') +':' + newLine
+               thisout = newLine + parent_level(level,'parent') +':' + newLine
                for ancestor in ancestors:
                        id = (ancestor,)
                        for row in run_query(s,id):
-                               out = out + name_html(row,newLine)+newLine
+                               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)
                ancestors = newA
+               if len(ancestors)>0:
+                       out  = out+thisout
        
 
        return [out, allAncestors,trackLevel]