本文整理汇总了Python中gramps.gen.lib.Person.get_gramps_id方法的典型用法代码示例。如果您正苦于以下问题:Python Person.get_gramps_id方法的具体用法?Python Person.get_gramps_id怎么用?Python Person.get_gramps_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.lib.Person
的用法示例。
在下文中一共展示了Person.get_gramps_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dump_parent
# 需要导入模块: from gramps.gen.lib import Person [as 别名]
# 或者: from gramps.gen.lib.Person import get_gramps_id [as 别名]
def dump_parent(self,title,person_handle):
if not person_handle and not self.missingInfo:
return
elif not person_handle:
person = Person()
else:
person = self.database.get_person_from_handle(person_handle)
name = self._name_display.display(person)
self.doc.start_table(title,'FGR-ParentTable')
self.doc.start_row()
self.doc.start_cell('FGR-ParentHead',3)
self.doc.start_paragraph('FGR-ParentName')
mark = ReportUtils.get_person_mark(self.database,person)
# translators: needed for French, ignore otherwise
self.doc.write_text(self._("%(str1)s: %(str2)s") % {
'str1' : title,
'str2' : name }, mark)
if self.gramps_ids:
gid = person.get_gramps_id()
if gid:
self.doc.write_text(" (%s)" % gid)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
birth_ref = person.get_birth_ref()
birth = None
evtName = self._("Birth")
if birth_ref:
birth = self.database.get_event_from_handle(birth_ref.ref)
if birth or self.missingInfo:
self.dump_parent_event(evtName,birth)
death_ref = person.get_death_ref()
death = None
evtName = self._("Death")
if death_ref:
death = self.database.get_event_from_handle(death_ref.ref)
if death or self.missingInfo:
self.dump_parent_event(evtName,death)
self.dump_parent_parents(person)
if self.incParEvents:
for event_ref in person.get_primary_event_ref_list():
if event_ref != birth_ref and event_ref != death_ref:
event = self.database.get_event_from_handle(event_ref.ref)
event_type = self._get_type(event.get_type())
self.dump_parent_event(self._(event_type),event)
if self.incParAddr:
addrlist = person.get_address_list()[:]
for addr in addrlist:
location = ReportUtils.get_address_str(addr)
date = self._get_date(addr.get_date_object())
self.doc.start_row()
self.doc.start_cell("FGR-TextContents")
self.doc.start_paragraph('FGR-Normal')
self.doc.write_text(self._("Address"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell("FGR-TextContents")
self.doc.start_paragraph('FGR-Normal')
self.doc.write_text(date)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell("FGR-TextContentsEnd")
self.doc.start_paragraph('FGR-Normal')
self.doc.write_text(location)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
if self.incParNotes:
for notehandle in person.get_note_list():
note = self.database.get_note_from_handle(notehandle)
self.dump_parent_noteline(self._("Note"), note)
if self.includeAttrs:
for attr in person.get_attribute_list():
attr_type = self._get_type(attr.get_type())
self.dump_parent_line(self._(attr_type),attr.get_value())
if self.incParNames:
for alt_name in person.get_alternate_names():
name_type = self._get_type(alt_name.get_type())
name = self._name_display.display_name(alt_name)
self.dump_parent_line(self._(name_type), name)
self.doc.end_table()