Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tags at import time #23

Open
bcornec opened this issue Dec 7, 2020 · 1 comment
Open

Use tags at import time #23

bcornec opened this issue Dec 7, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@bcornec
Copy link
Owner

bcornec commented Dec 7, 2020

As suggested at gramps-project/addons-source#473 (comment)

@romjerome
Copy link

romjerome commented Dec 7, 2020

It seems that something like:
self.title = tree.xpath('//title/text()')
could also provide a basic content (sourcing with references),
and could be useful for records management (update, delete, etc.),
like current description on events and internet item.

"Imported from Geneanet" string is not translated yet, but could be
more dynamic by looking at title page? Something like:

@@ -544,7 +544,10 @@ def get_or_create_event(self,gobj,attr,tran):
            event = Event()
            uptype = getattr(EventType,attr.upper())
            event.set_type(EventType(uptype))
-           event.set_description('Imported from Geaneanet')
+           if self.title == "": #TODO family event
+              event.set_description('Geneanet')
+           else:
+               event.set_description(str(self.title[0]))
            db.add_event(event,tran)

            eventref = EventRef()
@@ -716,6 +719,7 @@ def __init__(self,father,mother):
        # Pointer to the Gramps Family instance
        self.family = None
        # Geneanet properties
+       self.title = ""
        self.g_marriagedate = None
        self.g_marriageplace = None
        self.g_marriageplacecode = None
@@ -1116,6 +1118,7 @@ def from_geneanet(self,purl):
                    print(_("Unable to perform HTML analysis"))

                self.url = purl
+               self.title = tree.xpath('//title/text()')
@@ -1447,7 +1452,7 @@ def to_gramps(self):
                        found = True
                if not found:
                    url = Url()
-                   url.set_description("Imported from Geneanet")
+                   url.set_description(str(self.title[0]))
                    url.set_type(UrlType.WEB_HOME)
                    url.set_path(self.url)
                    grampsp.add_url(url)

need to polish and refactor a little bit, but this should be more accurate than the generic hard coded string.

'Not related ' tool, under utility item on menu, provides a sample for tag
set on individuals. Time could be one common marker for the import process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants