dabo Commit
Revision 5061
Date: 2009-02-16 06:36:11 -0800 (Mon, 16 Feb 2009)
Author: Ed
Trac: http://trac.dabodev.com/changeset/5061

Changed:
U   trunk/dabo/db/dbSQLite.py

Log:
Modified the code that checks for the existence of a database file to also look 
in any 'db' or 'data' subdirectory off of the current directory.


Diff:
Modified: trunk/dabo/db/dbSQLite.py
===================================================================
--- trunk/dabo/db/dbSQLite.py   2009-02-14 03:55:16 UTC (rev 5060)
+++ trunk/dabo/db/dbSQLite.py   2009-02-16 14:36:11 UTC (rev 5061)
@@ -55,6 +55,13 @@
                pth = os.path.expanduser(connectInfo.Database)
                if not forceCreate and not dabo.createDbFiles and (pth != 
":memory:"):
                        if not os.path.exists(pth):
+                               # See if it's in a standard data directory off 
of the current directory.
+                               for subdir in ("db", "data"):
+                                       newpth = os.path.join(subdir, pth)
+                                       if os.path.exists(newpth):
+                                               pth = newpth
+                                               break
+                       if not os.path.exists(pth):
                                # Database file does not exist; raise an error
                                raise DBFileDoesNotExistException(_("Database 
file '%s' does not exist") % pth)
                pth = pth.decode(dabo.fileSystemEncoding).encode("utf-8")



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to