4646: reports cannot be run from the command line in a non-GUI environment -- partial fix

svn: r18495
This commit is contained in:
Paul Franklin 2011-11-23 20:19:19 +00:00
parent bc33f7146a
commit 8485b57ba3

View File

@ -351,14 +351,14 @@ def run():
try: try:
build_user_paths() build_user_paths()
except OSError, msg: except OSError, msg:
error += [(_("Configuration error"), str(msg))] error += [(_("Configuration error:"), str(msg))]
return error return error
except msg: except msg:
LOG.error("Error reading configuration.", exc_info=True) LOG.error("Error reading configuration.", exc_info=True)
return [(_("Error reading configuration"), str(msg))] return [(_("Error reading configuration"), str(msg))]
if not mime_type_is_defined(const.APP_GRAMPS): if not mime_type_is_defined(const.APP_GRAMPS):
error += [(_("Configuration error"), error += [(_("Configuration error:"),
_("A definition for the MIME-type %s could not " _("A definition for the MIME-type %s could not "
"be found \n\n Possibly the installation of Gramps " "be found \n\n Possibly the installation of Gramps "
"was incomplete. Make sure the MIME-types " "was incomplete. Make sure the MIME-types "
@ -425,7 +425,12 @@ def run():
from guiQML.grampsqml import startqml from guiQML.grampsqml import startqml
startqml(error, argpars) startqml(error, argpars)
else: else:
from gui.grampsgui import startgtkloop try:
from gui.grampsgui import startgtkloop
# no DISPLAY is a RuntimeError in an older pygtk (e.g. F14's 2.17)
except RuntimeError, msg:
error += [(_("Configuration error:"), str(msg))]
return error
startgtkloop(error, argpars) startgtkloop(error, argpars)
else: else:
#CLI use of GRAMPS #CLI use of GRAMPS