本文整理汇总了Python中gramps.gen.proxy.CacheProxyDb.iter_family_handles方法的典型用法代码示例。如果您正苦于以下问题:Python CacheProxyDb.iter_family_handles方法的具体用法?Python CacheProxyDb.iter_family_handles怎么用?Python CacheProxyDb.iter_family_handles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.proxy.CacheProxyDb
的用法示例。
在下文中一共展示了CacheProxyDb.iter_family_handles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TagReport
# 需要导入模块: from gramps.gen.proxy import CacheProxyDb [as 别名]
# 或者: from gramps.gen.proxy.CacheProxyDb import iter_family_handles [as 别名]
#.........这里部分代码省略.........
name = self._name_display.display(person)
mark = utils.get_person_mark(self.database, person)
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
self.doc.write_text(name, mark)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
birth_ref = person.get_birth_ref()
if birth_ref:
event = self.database.get_event_from_handle(birth_ref.ref)
self.doc.write_text(self._get_date(event.get_date_object()))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
death_ref = person.get_death_ref()
if death_ref:
event = self.database.get_event_from_handle(death_ref.ref)
self.doc.write_text(self._get_date(event.get_date_object()))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
self.doc.end_table()
def write_families(self):
""" write the families associated with the tag """
flist = self.database.iter_family_handles()
filter_class = GenericFilterFactory('Family')
a_filter = filter_class()
a_filter.add_rule(rules.family.HasTag([self.tag]))
fam_list = a_filter.apply(self.database, flist)
if not fam_list:
return
self.doc.start_paragraph("TR-Heading")
header = self._("Families")
mark = IndexMark(header, INDEX_TYPE_TOC, 2)
self.doc.write_text(header, mark)
self.doc.end_paragraph()
self.doc.start_table('FamilyTable', 'TR-Table')
self.doc.start_row()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal-Bold')
self.doc.write_text(self._("Id"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal-Bold')
self.doc.write_text(self._("Father"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal-Bold')