From b6ee5a66a19b932714ced84d4573fb208c2f1b82 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Fri, 14 Jan 2011 12:07:53 +0200 Subject: [PATCH] Added a check at startup for sqlalchemy (installed/version) --- pyfa.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pyfa.py b/pyfa.py index fb51accc3..d78fc55ed 100755 --- a/pyfa.py +++ b/pyfa.py @@ -24,10 +24,26 @@ if not hasattr(sys, 'frozen'): try: import wxversion wxversion.ensureMinimal('2.8') - except: + except ImportError: print "Coulnd't find wxPython or the installed wxPython version doesn't meet the min. requirements.\nYou can download wxPython (2.8) from http://www.wxpython.org/" sys.exit(1) + try: + import sqlalchemy + + saVersion = sqlalchemy.__version__.split(".") + saMajor = int(saVersion[0]) + saMinor = int(saVersion[1]) + saBuild = int(saVersion[2]) + + if saMinor < 6: + print "Pyfa requires sqlalchemy 0.6+ but current sqlalchemy version is %s\nYou can download sqlalchemy (0.6+) from http://www.sqlalchemy.org/" % sqlalchemy.__version__ + sys.exit(1) + + except ImportError: + print "Coulnd't find sqlalchemy.\nYou can download sqlalchemy (0.6+) from http://www.sqlalchemy.org/" + sys.exit(1) + import config # try: