8196: Spurious spaces in CLI List Family Trees, tab delimited output.
Print statements changed to assemble the whole line before output.
This commit is contained in:
@@ -365,7 +365,7 @@ class ArgHandler(object):
|
|||||||
# Apparently it is not a database. See if it is a file that
|
# Apparently it is not a database. See if it is a file that
|
||||||
# can be imported.
|
# can be imported.
|
||||||
db_path, title = self.dbman.import_new_db(self.open_gui, self.user)
|
db_path, title = self.dbman.import_new_db(self.open_gui, self.user)
|
||||||
|
# Handle the "-l" List Family Trees option.
|
||||||
if db_path:
|
if db_path:
|
||||||
# Test if not locked or problematic
|
# Test if not locked or problematic
|
||||||
if not self.check_db(db_path, self.force_unlock):
|
if not self.check_db(db_path, self.force_unlock):
|
||||||
@@ -376,6 +376,7 @@ class ArgHandler(object):
|
|||||||
title = db_path
|
title = db_path
|
||||||
recent_files(db_path, title)
|
recent_files(db_path, title)
|
||||||
self.open = db_path
|
self.open = db_path
|
||||||
|
# Handle the "-L" List Family Trees in detail option.
|
||||||
self.__open_action()
|
self.__open_action()
|
||||||
else:
|
else:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
@@ -395,7 +396,7 @@ class ArgHandler(object):
|
|||||||
:param: climan: the manager of a CLI session
|
:param: climan: the manager of a CLI session
|
||||||
:type: :class:`.CLIManager` object
|
:type: :class:`.CLIManager` object
|
||||||
"""
|
"""
|
||||||
|
# Handle the "-l" List Family Trees option.
|
||||||
if self.list:
|
if self.list:
|
||||||
print(_('List of known Family Trees in your database path\n'))
|
print(_('List of known Family Trees in your database path\n'))
|
||||||
|
|
||||||
@@ -406,6 +407,7 @@ class ArgHandler(object):
|
|||||||
% {'full_DB_path' : dirname, 'f_t_name' : name})
|
% {'full_DB_path' : dirname, 'f_t_name' : name})
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
# Handle the "-L" List Family Trees in detail option.
|
||||||
if self.list_more:
|
if self.list_more:
|
||||||
print(_('Gramps Family Trees:'))
|
print(_('Gramps Family Trees:'))
|
||||||
summary_list = self.dbman.family_tree_summary()
|
summary_list = self.dbman.family_tree_summary()
|
||||||
@@ -418,25 +420,26 @@ class ArgHandler(object):
|
|||||||
print(_(" %s: %s") % (item, summary[item]))
|
print(_(" %s: %s") % (item, summary[item]))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
# Handle the "-t" List Family Trees, tab delimited option.
|
||||||
if self.list_table:
|
if self.list_table:
|
||||||
print(_('Gramps Family Trees:'))
|
print(_('Gramps Family Trees:'))
|
||||||
summary_list = self.dbman.family_tree_summary()
|
summary_list = self.dbman.family_tree_summary()
|
||||||
if not summary_list:
|
if not summary_list:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
print(_("Family Tree"), end="")
|
# We have to construct the line elements together, to avoid
|
||||||
|
# insertion of blank spaces when print on the same line is used
|
||||||
|
line_list = [_("Family Tree")]
|
||||||
for key in sorted(summary_list[0]):
|
for key in sorted(summary_list[0]):
|
||||||
if key != "Family Tree":
|
if key != _("Family Tree"):
|
||||||
print("\t ", end="")
|
line_list += [key]
|
||||||
print(key, end="")
|
print("\t".join(line_list))
|
||||||
print()
|
|
||||||
for summary in sorted(summary_list,
|
for summary in sorted(summary_list,
|
||||||
key=lambda sum: sum[_("Family Tree")].lower()):
|
key=lambda sum: sum[_("Family Tree")].lower()):
|
||||||
print('"%s"' % summary[_("Family Tree")], end="")
|
line_list = [('"%s"' % summary[_("Family Tree")])]
|
||||||
for item in sorted(summary):
|
for item in sorted(summary):
|
||||||
if item != _("Family Tree"):
|
if item != _("Family Tree"):
|
||||||
print("\t ", end="")
|
line_list += [('"%s"' % summary[item])]
|
||||||
print('"%s"' % summary[item], end="")
|
print("\t".join(line_list))
|
||||||
print()
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
self.__open_action()
|
self.__open_action()
|
||||||
|
Reference in New Issue
Block a user