diff options
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/persist_data.py | 14 |
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 | ||