本文整理汇总了Python中gramps.gui.plug.quick.QuickTable.set_callback方法的典型用法代码示例。如果您正苦于以下问题:Python QuickTable.set_callback方法的具体用法?Python QuickTable.set_callback怎么用?Python QuickTable.set_callback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gramps.gui.plug.quick.QuickTable
的用法示例。
在下文中一共展示了QuickTable.set_callback方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from gramps.gui.plug.quick import QuickTable [as 别名]
# 或者: from gramps.gui.plug.quick.QuickTable import set_callback [as 别名]
#.........这里部分代码省略.........
elif (filter_name == 'people with missing birth dates'):
stab.columns(_("Person"), _("Type"))
for person in database.iter_people():
birth_ref = person.get_birth_ref()
if birth_ref:
birth = database.get_event_from_handle(birth_ref.ref)
if not get_date(birth):
stab.row(person, _("birth event but no date"))
matches += 1
else:
stab.row(person, _("missing birth event"))
matches += 1
elif (filter_name == 'disconnected people'):
stab.columns(_("Person"), _("Birth Date"), _("Name type"))
for person in database.iter_people():
if ((not person.get_main_parents_family_handle()) and
(not len(person.get_family_handle_list()))):
stab.row(person, sdb.birth_or_fallback(person),
str(person.get_primary_name().get_type()))
matches += 1
elif (filter_name == 'unique surnames'):
namelist = defaultdict(int)
for person in database.iter_people():
names = [person.get_primary_name()] + person.get_alternate_names()
surnames = list(set([name.get_group_name() for name in names]))
for surname in surnames:
namelist[surname] += 1
stab.columns(_("Surname"), _("Count"))
for name in sorted(namelist):
stab.row(name, namelist[name])
matches += 1
stab.set_callback("leftdouble",
lambda name: run_quick_report_by_name_direct("samesurnames",
database,
document,
name))
elif (filter_name == 'people with media'):
stab.columns(_("Person"), _("Media count"))
for person in database.iter_people():
length = len(person.get_media_list())
if length > 0:
stab.row(person, str(length))
matches += 1
elif (filter_name == 'media references'):
stab.columns(_("Person"), _("Reference"))
for person in database.iter_people():
medialist = person.get_media_list()
for item in medialist:
stab.row(person, _("media"))
matches += 1
elif (filter_name == 'unique media'):
stab.columns(_("Unique Media"))
for photo in database.iter_media_objects():
fullname = media_path_full(database, photo.get_path())
stab.row(fullname)
matches += 1
elif (filter_name == 'missing media'):
stab.columns(_("Missing Media"))
for photo in database.iter_media_objects():
fullname = media_path_full(database, photo.get_path())