]> Nutra Git (v1) - gamesguru/getmyancestors.git/commitdiff
fix merge issues
authorlinek <benoitfontaine.ba@gmail.com>
Sat, 15 Jul 2017 20:20:38 +0000 (22:20 +0200)
committerlinek <benoitfontaine.ba@gmail.com>
Sat, 15 Jul 2017 20:20:38 +0000 (22:20 +0200)
getmyancestors.py
mergemyancestors.py

index e2a1b56cacff6bbcfc2886faa13ffa7554629cb7..96b2906b8a8512b740f6ff0c77b8001655c29483 100755 (executable)
@@ -508,7 +508,7 @@ class Indi:
         if self.name:
             self.name.print(file)
         for o in self.nicknames:
-            file.write('2 NICK ' + o.given + ' /' + o .surname + '/\n')
+            file.write('2 NICK ' + o.given + ' ' + o .surname + '\n')
         for o in self.birthnames:
             o.print(file)
         for o in self.aka:
@@ -579,7 +579,7 @@ class Indi:
         for o in self.sources:
             o[0].link(file, 1)
             if len(o) > 1:
-                file.write('2 PAGE ' + o[1].replace('\n', '\n1 CONT ') + '\n')
+                file.write('2 PAGE ' + o[1].replace('\n', '\n2 CONT ') + '\n')
 
 
 # GEDCOM family class
@@ -672,7 +672,7 @@ class Fam:
         for o in self.sources:
             o[0].link(file, 1)
             if len(o) > 1:
-                file.write('2 PAGE ' + o[1].replace('\n', '\n1 CONT ') + '\n')
+                file.write('2 PAGE ' + o[1].replace('\n', '\n2 CONT ') + '\n')
 
 
 # family tree class
index 4eef14a8b178a09a4a62ed8ff0c8469fd3668afd..ad6e21981fd9c530486bb98a1933ae59b8ccb9c4 100755 (executable)
@@ -115,7 +115,7 @@ class Gedcom:
                 self.indi[self.num].confirmation = self.__get_ordinance()
             elif self.tag == 'ENDL':
                 self.indi[self.num].endowment = self.__get_ordinance()
-            elif self.tag == 'SLGS':
+            elif self.tag == 'SLGC':
                 self.indi[self.num].sealing_child = self.__get_ordinance()
             elif self.tag == 'FAMS':
                 self.indi[self.num].fams_num.add(int(self.data[2:len(self.data) - 1]))
@@ -278,7 +278,8 @@ class Gedcom:
 
     def __get_link_source(self):
         num = int(self.data[2:len(self.data) - 1])
-        self.sour[num] = Source(num=num)
+        if num not in self.sour:
+            self.sour[num] = Source(num=num)
         page = None
         while self.__get_line() and self.level > 1:
             if self.tag == 'PAGE':
@@ -410,7 +411,7 @@ if __name__ == '__main__':
         else:
             n.num = list_notes[i - 1].num + 1
 
-    # merge notes by fid
+    # merge sources by fid
     list_sources = sorted(list_sources, key=lambda x: x.fid)
     for i, n in enumerate(list_sources):
         if i == 0: