dabo Commit
Revision 2217
Date: 2006-06-16 06:11:12 -0700 (Fri, 16 Jun 2006)
Author: ed

Changed:
U   trunk/dabo/__init__.py

Log:
Added explicit testing for SQLite, along with an informative warning if the 
required libraries are not present.


Diff:
Modified: trunk/dabo/__init__.py
===================================================================
--- trunk/dabo/__init__.py      2006-06-16 12:50:53 UTC (rev 2216)
+++ trunk/dabo/__init__.py      2006-06-16 13:11:12 UTC (rev 2217)
@@ -47,10 +47,15 @@
                nature of Dabo's design, it is possible to use just the
                db layer, or the db layer in conjunction with the biz
                layer, with no ui at all.)
+       
+       + SQLite3: this is used internally for managing preferences, as 
+               well as for cursor management.
+       
+       +       pysqlite2: The Python dbapi module for SQLite.
 
        + Windows 98SE or higher
        + Macintosh OSX 10.2 or higher (*much* nicer in Tiger - 10.4)
-       + Linux 2.4 with X11 running
+       + Linux 2.4 with X11 running and Gtk2
 
        + Access to some sort of database server, along with the 
        appropriate Python driver(s) installed. For example, for
@@ -92,15 +97,24 @@
 
 Have fun in your exploration of Dabo. 
 """
-# Import global settings (do this first, as other imports may rely on it):
-from settings import *
 
-# dApp will change the following values upon its __init__:
-dAppRef = None
+import sys
+try:
+       import pysqlite2
+except ImportError:
+       msg = """
 
+Dabo requires SQLite 3 and the pysqlite2 module. You will have to install these
+free products before running Dabo. You can get them from the following 
locations:
+
+SQLite: http://www.sqlite.org/download.html
+pysqlite2: http://initd.org/tracker/pysqlite
+
+"""    
+       sys.exit(msg)
+
 # Instantiate the logger object, which will send messages to user-overridable
 # locations. Do this before any other imports.
-import sys
 from dabo.lib.logger import Log
 infoLog = Log()
 infoLog.Caption = "Dabo Info Log"
@@ -109,6 +123,12 @@
 errorLog.Caption = "Dabo Error Log"
 errorLog.LogObject = sys.stderr
 
+# Import global settings (do this first, as other imports may rely on it):
+from settings import *
+
+# dApp will change the following values upon its __init__:
+dAppRef = None
+
 from __version__ import version
 import dColors
 import dEvents




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev

Reply via email to