]> Nutra Git (v1) - gamesguru/getmyancestors.git/commitdiff
Add empty __init__.py (useful to use the project as a package)
authorBenoît Fontaine <benoitfontaine.ba@gmail.com>
Wed, 3 Jan 2018 15:02:05 +0000 (16:02 +0100)
committerBenoît Fontaine <benoitfontaine.ba@gmail.com>
Wed, 3 Jan 2018 15:02:05 +0000 (16:02 +0100)
__init__.py [new file with mode: 0644]
getmyancestors.py

diff --git a/__init__.py b/__init__.py
new file mode 100644 (file)
index 0000000..56fafa5
--- /dev/null
@@ -0,0 +1,2 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
index 1c68ef8d8dc7de75d173acca4583e56a3ab5ef3d..79379e46413aa2a50538c6267ac47bfc3a8fa7b4 100755 (executable)
@@ -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))