- def load_cache(self, filename, rescanPaths = False):
- logging.debug('Attempting to load cache from "%s"' % filename)
- self.paths.sort()
- try:
- fd = open(filename, 'rb')
- tmp = pickle.load(fd)
- if self.paths == tmp.paths:
- logging.debug("Path lists match, copying properties")
- # Overwrite this object with the other
- for attr in ('list', 'imagePointer'):
- setattr(self, attr, getattr(tmp, attr))
- else:
- logging.debug("Ignoring cache, path lists do not match")
- except Exception, e:
- logging.warning("Loading cache", exc_info=1)
- else:
- return True
-