2008-02-25 Łukasz Rymarczyk <yenidai(at)poczta(dot)onet(dot)pl>

* src/ReportBase/_CommandLineReport.py: add user friendly output to cli 
	gramps.py -u --open=merge --action=report -p "name=indiv_complete,show=all"
	#0001823

svn: r10117
This commit is contained in:
Raphael Ackermann 2008-02-25 08:59:40 +00:00
parent 0f8aaff690
commit 3d1d81b746
2 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2008-02-25 Łukasz Rymarczyk <yenidai(at)poczta(dot)onet(dot)pl>
* src/ReportBase/_CommandLineReport.py: add user friendly output to cli
gramps.py -u --open=merge --action=report -p "name=indiv_complete,show=all"
#0001823
2008-02-25 Łukasz Rymarczyk <yenidai(at)poczta(dot)onet(dot)pl> 2008-02-25 Łukasz Rymarczyk <yenidai(at)poczta(dot)onet(dot)pl>
* src/ArgHandler.py: add UI Report Names to output * src/ArgHandler.py: add UI Report Names to output
0001826: Command line - viewing available reports nicer to read 0001826: Command line - viewing available reports nicer to read

View File

@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2001-2007 Donald N. Allingham # Copyright (C) 2001-2007 Donald N. Allingham
# Copyright (C) 2008 Lukasz Rymarczyk
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -198,14 +199,27 @@ class CommandLineReport:
self.options_help['style'].append(False) self.options_help['style'].append(False)
def show_options(self): def show_options(self):
"""
Print available options on the CLI.
"""
if not self.show: if not self.show:
return return
elif self.show == 'all': elif self.show == 'all':
print " Available options:" print " Available options:"
for key in self.options_dict.keys(): for key in self.options_dict.keys():
print " %s" % key if key in self.options_dict.keys():
print \ # Make the output nicer to read, assume that tab has 8 spaces
" Use 'show=option' to see description and acceptable values" if len(key) < 10:
print " %s\t\t%s (%s)" % (key,
self.options_help[key][1],
self.options_help[key][0])
else:
print " %s\t%s (%s)" % (key,
self.options_help[key][1],
self.options_help[key][0])
else:
print " %s" % key
print " Use 'show=option' to see description and acceptable values"
elif self.show in self.options_dict.keys(): elif self.show in self.options_dict.keys():
print ' %s%s\t%s' % (self.show, print ' %s%s\t%s' % (self.show,
self.options_help[self.show][0], self.options_help[self.show][0],