def save(self): """Save the state to the JSON file in the config dir.""" logger.debug("Save the GUI state to `%s`.", self.path) _save_json( self.path, {k: v for k, v in self.items() if k not in ('config_dir', 'name')})
def save(self, name, data, location='local', kind='json'): """Save a dictionary in a JSON file within the cache directory.""" file_ext = '.json' if kind == 'json' else '.pkl' path = self._get_path(name, location, file_ext=file_ext) _ensure_dir_exists(op.dirname(path)) logger.debug("Save data to `%s`.", path) if kind == 'json': _save_json(path, data) else: _save_pickle(path, data)
def save(self, name, data, location='local'): """Save a dictionary in a JSON file within the cache directory.""" path = self._get_path(name, location) _ensure_dir_exists(op.dirname(path)) logger.debug("Save data to `%s`.", path) _save_json(path, data)
def save(self): """Save the state to the JSON file in the config dir.""" logger.debug("Save the GUI state to `%s`.", self.path) _save_json(self.path, {k: v for k, v in self.items() if k not in ('config_dir', 'name')})