summaryrefslogtreecommitdiff
path: root/portato/db
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-08-15 00:46:21 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-08-15 00:46:21 +0200
commit4bd0501d3f533ee4d2ef8ee425b8dd60131a5980 (patch)
treeeb600292b1f5c1aa0756345bef6c4d7f0d36e5c1 /portato/db
parent0b50ae98f1e54a9e24dfc6ebc38c2a891bfa931e (diff)
downloadportato-4bd0501d3f533ee4d2ef8ee425b8dd60131a5980.tar.gz
portato-4bd0501d3f533ee4d2ef8ee425b8dd60131a5980.tar.bz2
portato-4bd0501d3f533ee4d2ef8ee425b8dd60131a5980.zip
Honor missing eix module
Diffstat (limited to 'portato/db')
-rw-r--r--portato/db/__init__.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/portato/db/__init__.py b/portato/db/__init__.py
index 9869e3f..a58ba61 100644
--- a/portato/db/__init__.py
+++ b/portato/db/__init__.py
@@ -50,8 +50,13 @@ def Database(type):
elif type == "eixsql":
debug("Using EixSQLDatabase")
- from .eix_sql import EixSQLDatabase
- return EixSQLDatabase(SectionDict(_SESSION, type))
+ try:
+ from .eix_sql import EixSQLDatabase
+ except ImportError:
+ warning(_("Cannot load EixSQLDatabase."))
+ return Database("sql")
+ else:
+ return EixSQLDatabase(SectionDict(_SESSION, type))
else:
error(_("Unknown database type: %s"), type)