From: linek Date: Sat, 15 Jul 2017 20:20:38 +0000 (+0200) Subject: fix merge issues X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=e20cec4743408283368f47e22bdbdfb1a5f69e59;p=gamesguru%2Fgetmyancestors.git fix merge issues --- diff --git a/getmyancestors.py b/getmyancestors.py index e2a1b56..96b2906 100755 --- a/getmyancestors.py +++ b/getmyancestors.py @@ -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 diff --git a/mergemyancestors.py b/mergemyancestors.py index 4eef14a..ad6e219 100755 --- a/mergemyancestors.py +++ b/mergemyancestors.py @@ -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: