From 022596af8a30a16c2c4f8cb9b2eb9f56c2859745 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sat, 20 Oct 2007 21:24:32 +0000 Subject: [PATCH] * src/gramps_main.py: if error and terminate, don't show family manager before exit * src/gramps.py: terminate if wrong python version 2007-10-20 Benny Malengier svn: r9221 --- ChangeLog | 4 ++++ src/gramps.py | 17 +++++++++++++++++ src/gramps_main.py | 16 ++-------------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2532469e..e5f1caaff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-10-20 Benny Malengier + * src/gramps_main.py: if error and terminate, don't show family manager before exit + * src/gramps.py: terminate if wrong python version + 2007-10-20 Benny Malengier * src/gramps_main.py: terminate if wrong python version diff --git a/src/gramps.py b/src/gramps.py index ce10b0b95..d9ee95ea1 100644 --- a/src/gramps.py +++ b/src/gramps.py @@ -90,6 +90,23 @@ except: gettext.textdomain("gramps") gettext.install("gramps",loc,unicode=1) +#------------------------------------------------------------------------- +# +# Minimum version check +# +#------------------------------------------------------------------------- + +MIN_PYTHON_VERSION = (2, 5, 0, '', 0) +if not sys.version_info >= MIN_PYTHON_VERSION : + print gettext.gettext("Your Python version does not meet the " + "requirements. At least python %d.%d.%d is needed to" + " start GRAMPS.\n\n" + "GRAMPS will terminate now.") % ( + MIN_PYTHON_VERSION[0], + MIN_PYTHON_VERSION[1], + MIN_PYTHON_VERSION[2]) + sys.exit(1) + #------------------------------------------------------------------------- # # gramps libraries diff --git a/src/gramps_main.py b/src/gramps_main.py index 117657cd7..7e925172e 100644 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -207,22 +207,8 @@ class Gramps: process. It may spawn several windows and control several databases. """ - MIN_PYTHON_VERSION = (2, 5, 0, '', 0) - def __init__(self, args): stopload = False - import sys - if not sys.version_info >= Gramps.MIN_PYTHON_VERSION : - ErrorDialog(_("Wrong Python version"), - _("Your Python version does not meet the " - "requirements. At least python %d.%d.%d is needed to" - " start GRAMPS.\n\n" - "GRAMPS will terminate now.") % ( - Gramps.MIN_PYTHON_VERSION[0], - Gramps.MIN_PYTHON_VERSION[1], - Gramps.MIN_PYTHON_VERSION[2])) - gtk.main_quit() - stopload = True try: build_user_paths() self.welcome() @@ -256,6 +242,8 @@ class Gramps: self.vm.register_view(view) if stopload: + # We stop further loading so family tree manager is not shown + # before the exit of GRAMPS return self.vm.init_interface()