gramps -L prints as it goes

Gramps -l now lists details as it goes, rather than after collecting details from all databases.
This commit is contained in:
Doug Blank 2015-12-13 10:49:47 -05:00
parent cff726a4bb
commit 7710544936
2 changed files with 18 additions and 11 deletions

View File

@ -402,17 +402,7 @@ class ArgHandler(object):
# Handle the "-L" List Family Trees in detail option. # Handle the "-L" List Family Trees in detail option.
if self.list_more: if self.list_more:
print(_('Gramps Family Trees:')) self.dbman.print_family_tree_summaries()
summary_list = self.dbman.family_tree_summary()
for summary in sorted(summary_list,
key=lambda sum: sum[_("Family Tree")].lower()):
print(_("Family Tree \"%s\":") % summary[_("Family Tree")])
for item in sorted(summary):
if item != "Family Tree":
# translators: needed for French, ignore otherwise
print(_(" %(item)s: %(summary)s") % {
'item' : item,
'summary' : summary[item] } )
sys.exit(0) sys.exit(0)
# Handle the "-t" List Family Trees, tab delimited option. # Handle the "-t" List Family Trees, tab delimited option.

View File

@ -172,6 +172,23 @@ class CLIDbManager(object):
}) })
return retval return retval
def print_family_tree_summaries(self):
"""
Prints a detailed list of the known family trees.
"""
print(_('Gramps Family Trees:'))
for item in self.current_names:
(name, dirpath, path_name, last,
tval, enable, stock_id) = item
summary = self.get_dbdir_summary(dirpath, name)
print(_("Family Tree \"%s\":") % summary[_("Family Tree")])
for item in sorted(summary):
if item != "Family Tree":
# translators: needed for French, ignore otherwise
print(_(" %(item)s: %(summary)s") % {
'item' : item,
'summary' : summary[item] } )
def family_tree_summary(self): def family_tree_summary(self):
""" """
Return a list of dictionaries of the known family trees. Return a list of dictionaries of the known family trees.