def write_cache(self): """ Write the cache to the cache file """ temp = dict() for key, value in self.cache.items(): if value.should_keep(): temp[key] = value.item # Unpack the item write_file(self.cache_directory, self.cache_file, temp)
def write_preferences(self): write_file(self.preferences_directory, self.preferences_file, self.serialize_preferences(self.preferences))