def save(self, path=None): if path is None: path = self._path if path is None: raise AttributeError("Don't know where to save black list") with open(path, "w") as black_file: json.dump(self._blacklist, black_file, separators=(',', ':')) self._autosave_counter = 0
def save(self, path=None): if path is None: path = self._path if path is None: raise AttributeError("Don't know where to save statistics") with open(path, "w") as stat_file: json.dump(self._stat, stat_file, separators=(',', ':')) self._autosave_counter = 0