summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/persist_data.py
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-12-23 10:36:39 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2011-01-05 00:58:23 +0000
commit478677fb624ff6093004a43a2cb9f9ce35cb4e1b (patch)
tree1f88cd6f6eb26dc6bf95d5b87d551cc76eae15ff /bitbake/lib/bb/persist_data.py
parent2671bb4197a06403e1cd3cedb0f6452046660d0a (diff)
downloadpoky-478677fb624ff6093004a43a2cb9f9ce35cb4e1b.tar.gz
persist_data: resurrect the lock wait for selects
Think this got inadvertantly dropped when switching to the new API. (Bitbake rev: 628c5159d1151b89f2b7210c8819489e8dc9a84d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/persist_data.py')
-rw-r--r--bitbake/lib/bb/persist_data.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py
index 4f87c37f2b..b8c2392945 100644
--- a/bitbake/lib/bb/persist_data.py
+++ b/bitbake/lib/bb/persist_data.py
@@ -64,8 +64,8 @@ class SQLTable(collections.MutableMapping):
64 raise 64 raise
65 65
66 def __getitem__(self, key): 66 def __getitem__(self, key):
67 data = self.cursor.execute("SELECT * from %s where key=?;" % 67 data = self._execute("SELECT * from %s where key=?;" %
68 self.table, [key]) 68 self.table, [key])
69 for row in data: 69 for row in data:
70 return row[1] 70 return row[1]
71 71
@@ -73,7 +73,7 @@ class SQLTable(collections.MutableMapping):
73 self._execute("DELETE from %s where key=?;" % self.table, [key]) 73 self._execute("DELETE from %s where key=?;" % self.table, [key])
74 74
75 def __setitem__(self, key, value): 75 def __setitem__(self, key, value):
76 data = self.cursor.execute("SELECT * from %s where key=?;" % 76 data = self._execute("SELECT * from %s where key=?;" %
77 self.table, [key]) 77 self.table, [key])
78 exists = len(list(data)) 78 exists = len(list(data))
79 if exists: 79 if exists:
@@ -87,22 +87,22 @@ class SQLTable(collections.MutableMapping):
87 return key in set(self) 87 return key in set(self)
88 88
89 def __len__(self): 89 def __len__(self):
90 data = self.cursor.execute("SELECT COUNT(key) FROM %s;" % self.table) 90 data = self._execute("SELECT COUNT(key) FROM %s;" % self.table)
91 for row in data: 91 for row in data:
92 return row[0] 92 return row[0]
93 93
94 def __iter__(self): 94 def __iter__(self):
95 data = self.cursor.execute("SELECT key FROM %s;" % self.table) 95 data = self._execute("SELECT key FROM %s;" % self.table)
96 for row in data: 96 for row in data:
97 yield row[0] 97 yield row[0]
98 98
99 def iteritems(self): 99 def iteritems(self):
100 data = self.cursor.execute("SELECT * FROM %s;" % self.table) 100 data = self._execute("SELECT * FROM %s;" % self.table)
101 for row in data: 101 for row in data:
102 yield row[0], row[1] 102 yield row[0], row[1]
103 103
104 def itervalues(self): 104 def itervalues(self):
105 data = self.cursor.execute("SELECT value FROM %s;" % self.table) 105 data = self._execute("SELECT value FROM %s;" % self.table)
106 for row in data: 106 for row in data:
107 yield row[0] 107 yield row[0]
108 108