summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Musca <constantinx.musca@intel.com>2013-01-22 09:37:57 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-22 15:35:06 (GMT)
commit5fc3fc343e5794764c4345f73b25b3f671a80a69 (patch)
treeb8e4225341475c6cb9dda5a3eb4ee862b0e3a979
parent1e50274f55cfea707c9640257d7dbfe3f429f7ec (diff)
downloadpoky-5fc3fc343e5794764c4345f73b25b3f671a80a69.tar.gz
bitbake: persist_data: add get_by_pattern method to API
- one can use get_by_pattern to get a list of values associated with keys that match the specified pattern (Bitbake rev: 6ee1f58698e2d782c54ce5aec271bcec26107eac) Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/persist_data.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/persist_data.py b/bitbake/lib/bb/persist_data.py
index c69758d..994e61b 100644
--- a/bitbake/lib/bb/persist_data.py
+++ b/bitbake/lib/bb/persist_data.py
@@ -125,6 +125,11 @@ class SQLTable(collections.MutableMapping):
125 125
126 return len(self) < len(other) 126 return len(self) < len(other)
127 127
128 def get_by_pattern(self, pattern):
129 data = self._execute("SELECT * FROM %s WHERE key LIKE ?;" %
130 self.table, [pattern])
131 return [row[1] for row in data]
132
128 def values(self): 133 def values(self):
129 return list(self.itervalues()) 134 return list(self.itervalues())
130 135