mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
...
This commit is contained in:
parent
aa2f592c98
commit
ced4126d04
@ -106,8 +106,11 @@ class GroupedSearchTerms(object):
|
|||||||
|
|
||||||
def __init__(self, src):
|
def __init__(self, src):
|
||||||
self.keys = frozenset(src)
|
self.keys = frozenset(src)
|
||||||
self.vals = frozenset(tuple(v) for v in src.itervalues())
|
self.hash = hash(self.keys)
|
||||||
self.hash = hash((self.keys, self.vals))
|
# We dont need to store values since this is used as part of a key for
|
||||||
|
# a cache and if the values have changed the cache will be invalidated
|
||||||
|
# for other reasons anyway (last_modified() will have changed on the
|
||||||
|
# db)
|
||||||
|
|
||||||
def __contains__(self, val):
|
def __contains__(self, val):
|
||||||
return val in self.keys
|
return val in self.keys
|
||||||
@ -115,6 +118,12 @@ class GroupedSearchTerms(object):
|
|||||||
def __hash__(self):
|
def __hash__(self):
|
||||||
return self.hash
|
return self.hash
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
try:
|
||||||
|
return self.keys == other.keys
|
||||||
|
except AttributeError:
|
||||||
|
return False
|
||||||
|
|
||||||
_icon_map = None
|
_icon_map = None
|
||||||
_icon_map_lock = Lock()
|
_icon_map_lock = Lock()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user