本文整理汇总了Python中gramps.gen.proxy.CacheProxyDb.get_citation_from_handle方法的典型用法代码示例。如果您正苦于以下问题:Python CacheProxyDb.get_citation_from_handle方法的具体用法?Python CacheProxyDb.get_citation_from_handle怎么用?Python CacheProxyDb.get_citation_from_handle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.proxy.CacheProxyDb
的用法示例。
在下文中一共展示了CacheProxyDb.get_citation_from_handle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TagReport
# 需要导入模块: from gramps.gen.proxy import CacheProxyDb [as 别名]
# 或者: from gramps.gen.proxy.CacheProxyDb import get_citation_from_handle [as 别名]
#.........这里部分代码省略.........
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
self.doc.write_text(source.get_author())
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
self.doc.write_text(source.get_publication_info())
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
self.doc.end_table()
def write_citations(self):
""" write the citations associated with the tag """
clist = self.database.get_citation_handles(sort_handles=True)
filter_class = GenericFilterFactory('Citation')
a_filter = filter_class()
a_filter.add_rule(rules.citation.HasTag([self.tag]))
citation_list = a_filter.apply(self.database, clist)
if not citation_list:
return
self.doc.start_paragraph("TR-Heading")
header = self._("Citations")
mark = IndexMark(header, INDEX_TYPE_TOC, 2)
self.doc.write_text(header, mark)
self.doc.end_paragraph()
self.doc.start_table('CitationTable', '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._("Volume/Page"))
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._("Date"))
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._("Source"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
for citation_handle in citation_list:
citation = self.database.get_citation_from_handle(citation_handle)
self.doc.start_row()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
self.doc.write_text(citation.get_gramps_id())
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
self.doc.write_text(citation.get_page())
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
date = self._get_date(citation.get_date_object())
if date:
self.doc.write_text(date)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('TR-TableCell')
self.doc.start_paragraph('TR-Normal')
source_handle = citation.get_reference_handle()
source = self.database.get_source_from_handle(source_handle)
self.doc.write_text(source.get_title())
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
self.doc.end_table()