From: linek Date: Fri, 3 Nov 2017 20:28:46 +0000 (+0100) Subject: supports empty notes X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=86257b973d3a4c4cf995e8287c5d2569f1ddb539;p=gamesguru%2Fgetmyancestors.git supports empty notes --- diff --git a/getmyancestors.py b/getmyancestors.py index ddc95d6..3783fde 100755 --- a/getmyancestors.py +++ b/getmyancestors.py @@ -505,7 +505,9 @@ class Indi: notes = self.tree.fs.get_url('https://familysearch.org/platform/tree/persons/' + self.fid + '/notes.json') if notes: for n in notes['persons'][0]['notes']: - self.notes.add(Note('===' + n['subject'] + '===\n' + n['text'] + '\n', self.tree)) + 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)) # retrieve LDS ordinances def get_ordinances(self): @@ -666,7 +668,9 @@ class Fam: notes = self.tree.fs.get_url('https://familysearch.org/platform/tree/couple-relationships/' + self.fid + '/notes.json') if notes: for n in notes['relationships'][0]['notes']: - self.notes.add(Note('===' + n['subject'] + '===\n' + n['text'] + '\n', self.tree)) + 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)) # retrieve contributors def get_contributors(self):