本文整理汇总了Python中gramps.gen.proxy.CacheProxyDb.get_event_handles方法的典型用法代码示例。如果您正苦于以下问题:Python CacheProxyDb.get_event_handles方法的具体用法?Python CacheProxyDb.get_event_handles怎么用?Python CacheProxyDb.get_event_handles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.proxy.CacheProxyDb
的用法示例。
在下文中一共展示了CacheProxyDb.get_event_handles方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TagReport
# 需要导入模块: from gramps.gen.proxy import CacheProxyDb [as 别名]
# 或者: from gramps.gen.proxy.CacheProxyDb import get_event_handles [as 别名]
#.........这里部分代码省略.........
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
father_handle = family.get_father_handle()
if father_handle:
father = self.database.get_person_from_handle(father_handle)
mark = utils.get_person_mark(self.database, father)
self.doc.write_text(self._name_display.display(father), mark)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
mother_handle = family.get_mother_handle()
if mother_handle:
mother = self.database.get_person_from_handle(mother_handle)
mark = utils.get_person_mark(self.database, mother)
self.doc.write_text(self._name_display.display(mother), mark)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
relation = family.get_relationship()
self.doc.write_text(str(relation))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
self.doc.end_table()
def write_events(self):
""" write the events associated with the tag """
elist = self.database.get_event_handles()
filter_class = GenericFilterFactory('Event')
a_filter = filter_class()
a_filter.add_rule(rules.event.HasTag([self.tag]))
event_list = a_filter.apply(self.database, elist)
if not event_list:
return
self.doc.start_paragraph("TR-Heading")
header = self._("Events")
mark = IndexMark(header, INDEX_TYPE_TOC, 2)
self.doc.write_text(header, mark)
self.doc.end_paragraph()
self.doc.start_table('EventTable', '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._("Type"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal-Bold')