From 266d7c02bef5fcff4b9c8d54ea95ae5d3cdf0162 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 09:54:51 -0600 Subject: [PATCH] Add iterallids method to ResultCache --- src/calibre/library/caches.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/library/caches.py b/src/calibre/library/caches.py index 3877314da9..68ed4cc092 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -176,6 +176,11 @@ class ResultCache(SearchQueryParser): if x is not None: yield x + def iterallids(self): + idx = self.FIELD_MAP['id'] + for x in self.iterall(): + yield x[idx] + def universal_set(self): return set([i[0] for i in self._data if i is not None])