From fb0a6779d26ee2003c5e1820c7d4afb09e971bdf Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sat, 20 Oct 2007 18:14:02 +0000 Subject: [PATCH] * src/gramps_main.py: terminate if wrong python version 2007-10-20 Benny Malengier svn: r9220 --- ChangeLog | 3 +++ src/gramps_main.py | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 63db4c19b..d2532469e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2007-10-20 Benny Malengier + * src/gramps_main.py: terminate if wrong python version + 2007-10-20 Benny Malengier * src/DisplayTabs/_BackRefModel.py: allow repository in backref (backref of note) * src/DisplayTabs/_BackRefList.py: allow edit of repository from backrefs diff --git a/src/gramps_main.py b/src/gramps_main.py index da316dc05..117657cd7 100644 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -206,8 +206,23 @@ class Gramps: There can be only one instance of this class per gramps application 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() @@ -219,6 +234,7 @@ class Gramps: "was incomplete. Make sure the GConf schema " "of GRAMPS is properly installed.")) gtk.main_quit() + stopload = True except: log.error("Error reading configuration.", exc_info=True) @@ -230,6 +246,7 @@ class Gramps: "of GRAMPS are properly installed.") % const.APP_GRAMPS) gtk.main_quit() + stopload = True register_stock_icons() @@ -238,6 +255,9 @@ class Gramps: for view in DataViews.get_views(): self.vm.register_view(view) + if stopload: + return + self.vm.init_interface() # Depending on the nature of this session,