Merged trunk r18499 through r18539 into geps023.
Conflicts resolved in:
gramps.pot
svn: r18540
This commit is contained in:
@@ -165,7 +165,7 @@ def _validate_options(options, dbase):
|
||||
phandle = None
|
||||
person = dbase.get_person_from_handle(phandle)
|
||||
if not person:
|
||||
print "ERROR: Please specify a person"
|
||||
print _("ERROR: Please specify a person")
|
||||
if person:
|
||||
option.set_value(person.get_gramps_id())
|
||||
|
||||
@@ -189,7 +189,7 @@ def _validate_options(options, dbase):
|
||||
family = dbase.get_family_from_handle(family_handle)
|
||||
option.set_value(family.get_gramps_id())
|
||||
else:
|
||||
print "ERROR: Please specify a family"
|
||||
print _("ERROR: Please specify a family")
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -400,9 +400,12 @@ class CommandLineReport(object):
|
||||
elif isinstance(option, Option):
|
||||
self.options_help[name].append(option.get_help())
|
||||
else:
|
||||
print "Unknown option: ", option
|
||||
print " Valid options are:", ", ".join(self.options_dict.keys())
|
||||
print " Use 'show=option' to see description and acceptable values"
|
||||
print _("Unknown option: %s") % option
|
||||
print _(" Valid options are:"), ", ".join(
|
||||
self.options_dict.keys())
|
||||
print (_(" Use '%(donottranslate)s' to see description "
|
||||
"and acceptable values") %
|
||||
{'donottranslate' : "show=option"})
|
||||
|
||||
def parse_options(self):
|
||||
"""
|
||||
@@ -427,13 +430,17 @@ class CommandLineReport(object):
|
||||
option.set_value(self.options_dict[opt])
|
||||
|
||||
else:
|
||||
print "Ignoring unknown option: %s" % opt
|
||||
print " Valid options are:", ", ".join(self.options_dict.keys())
|
||||
print " Use 'show=option' to see description and acceptable values"
|
||||
print _("Ignoring unknown option: %s") % opt
|
||||
print _(" Valid options are:"), ", ".join(
|
||||
self.options_dict.keys())
|
||||
print (_(" Use '%(donottranslate)s' to see description "
|
||||
"and acceptable values") %
|
||||
{'donottranslate' : "show=option"})
|
||||
|
||||
self.option_class.handler.output = self.options_dict['of']
|
||||
|
||||
self.css_filename = None
|
||||
_chosen_format = None
|
||||
if self.category == CATEGORY_TEXT:
|
||||
for plugin in self.__textdoc_plugins:
|
||||
if plugin.get_extension() == self.options_dict['off']:
|
||||
@@ -442,6 +449,7 @@ class CommandLineReport(object):
|
||||
if self.format is None:
|
||||
# Pick the first one as the default.
|
||||
self.format = self.__textdoc_plugins[0].get_basedoc()
|
||||
_chosen_format = self.__textdoc_plugins[0].get_extension()
|
||||
elif self.category == CATEGORY_DRAW:
|
||||
for plugin in self.__drawdoc_plugins:
|
||||
if plugin.get_extension() == self.options_dict['off']:
|
||||
@@ -449,6 +457,7 @@ class CommandLineReport(object):
|
||||
if self.format is None:
|
||||
# Pick the first one as the default.
|
||||
self.format = self.__drawdoc_plugins[0].get_basedoc()
|
||||
_chosen_format = self.__drawdoc_plugins[0].get_extension()
|
||||
elif self.category == CATEGORY_BOOK:
|
||||
for plugin in self.__bookdoc_plugins:
|
||||
if plugin.get_extension() == self.options_dict['off']:
|
||||
@@ -456,6 +465,7 @@ class CommandLineReport(object):
|
||||
if self.format is None:
|
||||
# Pick the first one as the default.
|
||||
self.format = self.__bookdoc_plugins[0].get_basedoc()
|
||||
_chosen_format = self.__bookdoc_plugins[0].get_extension()
|
||||
elif self.category == CATEGORY_GRAPHVIZ:
|
||||
for graph_format in graphdoc.FORMATS:
|
||||
if graph_format['ext'] == self.options_dict['off']:
|
||||
@@ -464,8 +474,17 @@ class CommandLineReport(object):
|
||||
if self.format is None:
|
||||
# Pick the first one as the default.
|
||||
self.format = graphdoc.FORMATS[0]["class"]
|
||||
_chosen_format = graphdoc.FORMATS[0]["ext"]
|
||||
else:
|
||||
self.format = None
|
||||
if _chosen_format and self.options_str_dict.has_key('off'):
|
||||
print (_("Ignoring '%(notranslate1)s=%(notranslate2)s' "
|
||||
"and using '%(notranslate1)s=%(notranslate3)s'.") %
|
||||
{'notranslate1' : "off",
|
||||
'notranslate2' : self.options_dict['off'],
|
||||
'notranslate3' : _chosen_format})
|
||||
print (_("Use '%(notranslate)s' to see valid values.") %
|
||||
{'notranslate' : "show=off"})
|
||||
|
||||
for paper in paper_sizes:
|
||||
if paper.get_name() == self.options_dict['papers']:
|
||||
@@ -498,23 +517,25 @@ class CommandLineReport(object):
|
||||
if not self.show:
|
||||
return
|
||||
elif self.show == 'all':
|
||||
print " Available options:"
|
||||
print _(" Available options:")
|
||||
for key in sorted(self.options_dict.keys()):
|
||||
if key in self.options_help:
|
||||
opt = self.options_help[key]
|
||||
# Make the output nicer to read, assume that tab has 8 spaces
|
||||
# Make the output nicer to read, assume a tab has 8 spaces
|
||||
tabs = '\t\t' if len(key) < 10 else '\t'
|
||||
optmsg = " %s%s%s (%s)" % (key, tabs, opt[1], opt[0])
|
||||
print optmsg.encode(sys.getfilesystemencoding())
|
||||
else:
|
||||
optmsg = " %s" % key
|
||||
print optmsg.encode(sys.getfilesystemencoding())
|
||||
print " Use 'show=option' to see description and acceptable values"
|
||||
print (_(" Use '%(donottranslate)s' to see description "
|
||||
"and acceptable values") %
|
||||
{'donottranslate' : "show=option"})
|
||||
elif self.show in self.options_help:
|
||||
opt = self.options_help[self.show]
|
||||
tabs = '\t\t' if len(self.show) < 10 else '\t'
|
||||
print ' %s%s%s (%s)' % (self.show, tabs, opt[1], opt[0])
|
||||
print " Available values are:"
|
||||
print _(" Available values are:")
|
||||
vals = opt[2]
|
||||
if isinstance(vals, (list, tuple)):
|
||||
for val in vals:
|
||||
@@ -526,8 +547,9 @@ class CommandLineReport(object):
|
||||
|
||||
else:
|
||||
#there was a show option given, but the option is invalid
|
||||
print ("option '%s' not valid. Use 'show=all' to see all valid "
|
||||
"options." % self.show)
|
||||
print (_("option '%(optionname)s' not valid. "
|
||||
"Use '%(donottranslate)s' to see all valid options.") %
|
||||
{'optionname' : self.show, 'donottranslate' : "show=all"})
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
@@ -570,6 +592,8 @@ def cl_report(database, name, category, report_class, options_class,
|
||||
(m1, m2) = msg.messages()
|
||||
print err_msg
|
||||
print m1
|
||||
if m2:
|
||||
print m2
|
||||
except:
|
||||
if len(log.handlers) > 0:
|
||||
log.error(err_msg, exc_info=True)
|
||||
|
||||
Reference in New Issue
Block a user