summaryrefslogtreecommitdiffstats
path: root/lib/bb/persist_data.py
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2007-07-29 21:36:39 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2007-07-29 21:36:39 +0000
commit89bbfe40b9ae3c4cb7ebefcdbde6fe0b6f981e38 (patch)
treee568eb1f39dd82c301eb15694fc56bd41a24ab6f /lib/bb/persist_data.py
parent1cbe52b9b6d15b6c8878fa8c3aac06c804dc6be2 (diff)
downloadbitbake-contrib-89bbfe40b9ae3c4cb7ebefcdbde6fe0b6f981e38.tar.gz
persist_data.py: Try harder to import an sqlite package. Show how to change the connection lock timeout
Diffstat (limited to 'lib/bb/persist_data.py')
-rw-r--r--lib/bb/persist_data.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bb/persist_data.py b/lib/bb/persist_data.py
index b00afe650..4df335a6a 100644
--- a/lib/bb/persist_data.py
+++ b/lib/bb/persist_data.py
@@ -20,7 +20,10 @@ import bb, os
try:
import sqlite3
except ImportError:
- bb.msg.fatal(bb.msg.domain.PersistData, "Importing sqlite3 failed, please install it.")
+ try:
+ from pysqlite2 import dbapi2 as sqlite3
+ except ImportError:
+ bb.msg.fatal(bb.msg.domain.PersistData, "Importing sqlite3 and pysqlite2 failed, please install one of them. A 'python-pysqlite2' like package is likely to be what you need.")
class PersistData:
"""
@@ -47,7 +50,7 @@ class PersistData:
self.cachefile = os.path.join(self.cachedir,"bb_persist_data.sqlite3")
bb.msg.debug(1, bb.msg.domain.PersistData, "Using '%s' as the persistent data cache" % self.cachefile)
- self.connection = sqlite3.connect(self.cachefile, isolation_level=None)
+ self.connection = sqlite3.connect(self.cachefile, timeout=5, isolation_level=None)
def addDomain(self, domain):
"""