* 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  <benny.malengier@gramps-project.org>


svn: r9221
This commit is contained in:
Benny Malengier 2007-10-20 21:24:32 +00:00
parent fb0a6779d2
commit 022596af8a
3 changed files with 23 additions and 14 deletions

View File

@ -1,3 +1,7 @@
2007-10-20 Benny Malengier <benny.malengier@gramps-project.org>
* 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 <benny.malengier@gramps-project.org>
* src/gramps_main.py: terminate if wrong python version

View File

@ -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

View File

@ -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()