예제 #1
0
 def get_obj(self, handle):
     name2 = ""
     if self.namespace == 'Person':
         person = self.db.get_person_from_handle(handle)
         name = name_displayer.sorted(person)
         gid = person.get_gramps_id()
         obj = person
     elif self.namespace == 'Family':
         family = self.db.get_family_from_handle(handle)
         name = family_name(family, self.db)
         gid = family.get_gramps_id()
         obj = family
     elif self.namespace == 'Event':
         event = self.db.get_event_from_handle(handle)
         name = str(event.get_type())
         name2 = event.get_description()
         gid = event.get_gramps_id()
         obj = event
     elif self.namespace == 'Source':
         source = self.db.get_source_from_handle(handle)
         name = source.get_title()
         gid = source.get_gramps_id()
         obj = source
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_handle(handle)
         src_handle = citation.get_reference_handle()
         source = self.db.get_source_from_handle(src_handle)
         name = citation.get_page()
         name2 = source.get_title()
         gid = citation.get_gramps_id()
         obj = citation
     elif self.namespace == 'Place':
         place = self.db.get_place_from_handle(handle)
         name = place_displayer.display(self.db, place)
         gid = place.get_gramps_id()
         obj = place
     elif self.namespace == 'Media':
         obj = self.db.get_media_from_handle(handle)
         name = obj.get_description()
         gid = obj.get_gramps_id()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_handle(handle)
         name = repo.get_name()
         gid = repo.get_gramps_id()
         obj = repo
     elif self.namespace == 'Note':
         note = self.db.get_note_from_handle(handle)
         name = note.get().replace('\n', ' ')
         if len(name) > 80:
             name = name[:80]+"..."
         gid = note.get_gramps_id()
         obj = note
     return (gid, name, name2, obj)
예제 #2
0
 def get_name_id(self, handle):
     if self.namespace == 'Person':
         person = self.db.get_person_from_handle(handle)
         name = _nd.sorted(person)
         gid = person.get_gramps_id()
     elif self.namespace == 'Family':
         family = self.db.get_family_from_handle(handle)
         name = family_name(family, self.db)
         gid = family.get_gramps_id()
     elif self.namespace == 'Event':
         event = self.db.get_event_from_handle(handle)
         name = event.get_description()
         gid = event.get_gramps_id()
     elif self.namespace == 'Source':
         source = self.db.get_source_from_handle(handle)
         name = source.get_title()
         gid = source.get_gramps_id()
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_handle(handle)
         name = citation.get_page()
         gid = citation.get_gramps_id()
     elif self.namespace == 'Place':
         place = self.db.get_place_from_handle(handle)
         name = _pd.display(self.db, place)
         gid = place.get_gramps_id()
     elif self.namespace == 'Media':
         obj = self.db.get_object_from_handle(handle)
         name = obj.get_description()
         gid = obj.get_gramps_id()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_handle(handle)
         name = repo.get_name()
         gid = repo.get_gramps_id()
     elif self.namespace == 'Note':
         note = self.db.get_note_from_handle(handle)
         name = note.get().replace('\n', ' ')
         if len(name) > 80:
             name = name[:80] + "..."
         gid = note.get_gramps_id()
     return (name, gid)
예제 #3
0
 def get_name_id(self, handle):
     if self.namespace == 'Person':
         person = self.db.get_person_from_handle(handle)
         name = _nd.sorted(person)
         gid = person.get_gramps_id()
     elif self.namespace == 'Family':
         family = self.db.get_family_from_handle(handle)
         name = family_name(family, self.db)
         gid = family.get_gramps_id()
     elif self.namespace == 'Event':
         event = self.db.get_event_from_handle(handle)
         name = event.get_description()
         gid = event.get_gramps_id()
     elif self.namespace == 'Source':
         source = self.db.get_source_from_handle(handle)
         name = source.get_title()
         gid = source.get_gramps_id()
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_handle(handle)
         name = citation.get_page()
         gid = citation.get_gramps_id()
     elif self.namespace == 'Place':
         place = self.db.get_place_from_handle(handle)
         name = _pd.display(self.db, place)
         gid = place.get_gramps_id()
     elif self.namespace == 'Media':
         obj = self.db.get_media_from_handle(handle)
         name = obj.get_description()
         gid = obj.get_gramps_id()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_handle(handle)
         name = repo.get_name()
         gid = repo.get_gramps_id()
     elif self.namespace == 'Note':
         note = self.db.get_note_from_handle(handle)
         name = note.get().replace('\n', ' ')
         if len(name) > 80:
             name = name[:80]+"..."
         gid = note.get_gramps_id()
     return (name, gid)