]> Nutra Git (v2) - gamesguru/getmyancestors.git/commitdiff
added military services
authorlinek <benoitfontaine.ba@gmail.com>
Mon, 17 Jul 2017 20:43:29 +0000 (22:43 +0200)
committerlinek <benoitfontaine.ba@gmail.com>
Mon, 17 Jul 2017 20:43:29 +0000 (22:43 +0200)
getmyancestors.py
mergemyancestors.py

index 6c90d9770ba9027702f59a128c2c4147461bcf2c..df7c243c27bbf5df2c971400067ef27a7df41ede 100755 (executable)
@@ -388,6 +388,7 @@ class Indi:
         self.physical_descriptions = set()
         self.nicknames = set()
         self.occupations = set()
+        self.military = set()
         self.birthnames = set()
         self.married = set()
         self.aka = set()
@@ -435,6 +436,8 @@ class Indi:
                         self.physical_descriptions.add(Fact(y))
                     if y['type'] == u'http://gedcomx.org/Occupation':
                         self.occupations.add(Fact(y))
+                    if y['type'] == u'http://gedcomx.org/MilitaryService':
+                        self.military.add(Fact(y))
                 if 'sources' in x:
                     for y in x['sources']:
                         json = fs.get_url(y['links']['description']['href'])['sourceDescriptions'][0]
@@ -583,6 +586,14 @@ class Indi:
                 file.write('2 PLAC ' + o.place + '\n')
             if o.note:
                 o.note.link(file, 2)
+        for o in self.military:
+            file.write('1 _MILT ' + o.value + '\n')
+            if o.date:
+                file.write('2 DATE ' + o.date + '\n')
+            if o.place:
+                file.write('2 PLAC ' + o.place + '\n')
+            if o.note:
+                o.note.link(file, 2)
         file.write('1 _FSFTID ' + self.fid + '\n')
         for o in self.notes:
             o.link(file)
index 604ecb31113038b42ac7707eab3948f650d35ebc..7b9a456afbd9b6e4e298a94c0bb001da396dca8b 100755 (executable)
@@ -108,7 +108,7 @@ class Gedcom:
                 self.__get_deat()
             elif self.tag == 'BURI':
                 self.__get_buri()
-            elif self.tag == 'DSCR' or self.tag == 'OCCU':
+            elif self.tag == 'DSCR' or self.tag == 'OCCU' or self.tag == '_MILT':
                 self.__get_fact()
             elif self.tag == 'BAPL':
                 self.indi[self.num].baptism = self.__get_ordinance()
@@ -250,6 +250,8 @@ class Gedcom:
             self.indi[self.num].physical_descriptions.add(fact)
         elif self.tag == 'OCCU':
             self.indi[self.num].occupations.add(fact)
+        elif self.tag == '_MILT':
+            self.indi[self.num].military.add(fact)
         while self.__get_line() and self.level > 1:
             if self.tag == 'DATE':
                 fact.date = self.data
@@ -386,6 +388,7 @@ if __name__ == '__main__':
             tree.indi[fid].buriplac = ged.indi[num].buriplac
             tree.indi[fid].physical_descriptions = ged.indi[num].physical_descriptions
             tree.indi[fid].occupations = ged.indi[num].occupations
+            tree.indi[fid].military = ged.indi[num].military
             tree.indi[fid].notes = ged.indi[num].notes
             tree.indi[fid].sources = ged.indi[num].sources
             tree.indi[fid].baptism = ged.indi[num].baptism