From 7fe122be682a807c12fd095ada695e1e3812f066 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 May 2010 09:27:26 -0600 Subject: [PATCH] Add iterall method to iterate over entire 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 9ed150733a..3877314da9 100644 --- a/src/calibre/library/caches.py +++ b/src/calibre/library/caches.py @@ -171,6 +171,11 @@ class ResultCache(SearchQueryParser): for id in self._map_filtered: yield self._data[id] + def iterall(self): + for x in self._data: + if x is not None: + yield x + def universal_set(self): return set([i[0] for i in self._data if i is not None])