From: linek Date: Mon, 17 Jul 2017 20:43:29 +0000 (+0200) Subject: added military services X-Git-Url: https://git.nutra.tk/v2?a=commitdiff_plain;h=50f3371e306b63e46dbacd8dd0c53c8419826637;p=gamesguru%2Fgetmyancestors.git added military services --- diff --git a/getmyancestors.py b/getmyancestors.py index 6c90d97..df7c243 100755 --- a/getmyancestors.py +++ b/getmyancestors.py @@ -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) diff --git a/mergemyancestors.py b/mergemyancestors.py index 604ecb3..7b9a456 100755 --- a/mergemyancestors.py +++ b/mergemyancestors.py @@ -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