本文整理汇总了Python中gramps.gen.simple.SimpleAccess.describe方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleAccess.describe方法的具体用法?Python SimpleAccess.describe怎么用?Python SimpleAccess.describe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gen.simple.SimpleAccess
的用法示例。
在下文中一共展示了SimpleAccess.describe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from gramps.gen.simple import SimpleAccess [as 别名]
# 或者: from gramps.gen.simple.SimpleAccess import describe [as 别名]
def main(self):
database = self.dbstate.db
simple_a = SimpleAccess(database)
# stime = time.perf_counter()
counts_list = {}
count = 0
self.model.clear()
for person in database.iter_people():
if count == 200:
count = 0
yield True
count += 1
result = len(countem(database, person, counts_list))
self.model.append((simple_a.describe(person), result,
person.handle))
self.set_has_data(len(self.model) > 0)
示例2: write_report
# 需要导入模块: from gramps.gen.simple import SimpleAccess [as 别名]
# 或者: from gramps.gen.simple.SimpleAccess import describe [as 别名]
def write_report(self):
"""
The routine that actually creates the report.
At this point, the document is opened and ready for writing.
"""
sdb = SimpleAccess(self.database)
self.doc.start_paragraph("NoteLink-Title")
title = _("Note Link Check Report")
mark = IndexMark(title, INDEX_TYPE_TOC, 1)
self.doc.write_text(title, mark)
self.doc.end_paragraph()
self.doc.start_table('NoteLinkTable','NoteLink-Table')
self.doc.start_row()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal-Bold')
self.doc.write_text(_("Note ID"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal-Bold')
self.doc.write_text(_("Link Type"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal-Bold')
self.doc.write_text(_("Links To"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal-Bold')
self.doc.write_text(_("Status"))
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
for note in self.database.iter_notes():
for (ldomain, ltype, lprop, lvalue) in note.get_links():
if ldomain == "gramps":
tagtype = _(ltype)
ref_obj = sdb.get_link(ltype, lprop, lvalue)
if ref_obj:
tagvalue = sdb.describe(ref_obj)
tagcheck = _("Ok")
else:
tagvalue = "%s://%s/%s/%s" % (ldomain, ltype, lprop, lvalue)
tagcheck = _("Failed")
else:
tagtype = _("Internet")
tagvalue = lvalue
tagcheck = ""
self.doc.start_row()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal')
self.doc.write_text(note.gramps_id)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal')
self.doc.write_text(tagtype)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal')
self.doc.write_text(tagvalue)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.start_cell('NoteLink-TableCell')
self.doc.start_paragraph('NoteLink-Normal')
self.doc.write_text(tagcheck)
self.doc.end_paragraph()
self.doc.end_cell()
self.doc.end_row()
self.doc.end_table()