summaryrefslogtreecommitdiff
path: root/portato/db
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-09-05 21:08:09 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-09-05 21:08:09 +0200
commit3e3ca0c5438cf25250feaaed3a2aeb87556c7631 (patch)
treecd3e3be9dd7fc945e9eba6885d0daca32517cf9e /portato/db
parentc9ffb9d6d68161f1063adbaecb9c1db925745c2e (diff)
downloadportato-3e3ca0c5438cf25250feaaed3a2aeb87556c7631.tar.gz
portato-3e3ca0c5438cf25250feaaed3a2aeb87556c7631.tar.bz2
portato-3e3ca0c5438cf25250feaaed3a2aeb87556c7631.zip
Print database type at the bottom of exceptions. NOTE: This does not handle multiple databases used at the same time
Diffstat (limited to '')
-rw-r--r--portato/db/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/portato/db/__init__.py b/portato/db/__init__.py
index 60cb1c9..190fa8a 100644
--- a/portato/db/__init__.py
+++ b/portato/db/__init__.py
@@ -19,6 +19,7 @@ class UnknownDatabaseTypeError (Exception):
pass
_SESSION = None
+_TYPE = None
types = {
"sql": (_("SQLite"), _("Uses an SQLite-database to store package information.\nMay take longer to generate at the first time, but has advantages if portato is re-started with an unchanged portage tree. Additionally it allows to use fast SQL expressions for fetching the data.")),
@@ -27,12 +28,14 @@ types = {
}
def Database(type):
- global _SESSION
+ global _SESSION, _TYPE
if _SESSION is None:
_SESSION = Session("db.cfg", name = "DB")
_SESSION.load()
+ _TYPE = type
+
if type == "sql":
debug("Using SQLDatabase")
try: