From: BenoƮt Fontaine Date: Wed, 3 Jan 2018 15:02:05 +0000 (+0100) Subject: Add empty __init__.py (useful to use the project as a package) X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=e5b038323609afebcf941491e637e63a5350a061;p=gamesguru%2Fgetmyancestors.git Add empty __init__.py (useful to use the project as a package) --- diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..56fafa5 --- /dev/null +++ b/__init__.py @@ -0,0 +1,2 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- diff --git a/getmyancestors.py b/getmyancestors.py index 1c68ef8..79379e4 100755 --- a/getmyancestors.py +++ b/getmyancestors.py @@ -589,8 +589,7 @@ class Indi: notes = self.tree.fs.get_url('https://familysearch.org/platform/tree/persons/%s/notes.json' % self.fid) if notes: for n in notes['persons'][0]['notes']: - text_note = '===' + n['subject'] + \ - '===\n' if 'subject' in n else '' + text_note = '=== ' + n['subject'] + ' ===\n' if 'subject' in n else '' text_note += n['text'] + '\n' if 'text' in n else '' self.notes.add(Note(text_note, self.tree)) @@ -604,16 +603,16 @@ class Indi: for o in data: if o['type'] == u'http://lds.org/Baptism': self.baptism = Ordinance(o) - if o['type'] == u'http://lds.org/Confirmation': + elif o['type'] == u'http://lds.org/Confirmation': self.confirmation = Ordinance(o) - if o['type'] == u'http://lds.org/Endowment': + elif o['type'] == u'http://lds.org/Endowment': self.endowment = Ordinance(o) - if o['type'] == u'http://lds.org/SealingChildToParents': + elif o['type'] == u'http://lds.org/SealingChildToParents': self.sealing_child = Ordinance(o) if 'father' in o and 'mother' in o: famc = (o['father']['resourceId'], o['mother']['resourceId']) - if o['type'] == u'http://lds.org/SealingToSpouse': + elif o['type'] == u'http://lds.org/SealingToSpouse': res.append(o) return res, famc @@ -727,8 +726,7 @@ class Fam: notes = self.tree.fs.get_url('https://familysearch.org/platform/tree/couple-relationships/%s/notes.json' % self.fid) if notes: for n in notes['relationships'][0]['notes']: - text_note = '===' + n['subject'] + \ - '===\n' if 'subject' in n else '' + text_note = '=== ' + n['subject'] + ' ===\n' if 'subject' in n else '' text_note += n['text'] + '\n' if 'text' in n else '' self.notes.add(Note(text_note, self.tree))