+ def load_cache(self, filename):
+ try:
+ logging.debug("Attempting to load cache from: %s" % filename)
+ self.paths.sort()
+
+ fd = open(filename, 'rb')
+ tmp = pickle.load(fd)
+
+ if tmp.__class__ != self.__class__:
+ raise ValueError("Using different file list type")
+
+ self.paths.sort()
+ if self.paths != getattr(tmp, "paths"):
+ raise ValueError("Path list changed")
+
+ for attr, value in tmp.__dict__.items():
+ setattr(self, attr, value)
+
+ return True
+
+ except Exception, e:
+ logging.warning("Loading cache: %s" % e)
+ return False
+
+ def add_to_favourites(self):
+ '''Adds the current image to the list of favourites'''
+ self.favourites.append(self.get_current_image())
+
+ def scan_paths(self):
+ raise NotImplementedError()