def _save_hook(self, textbox: vpython.winput): try: common.write_savefile(self._state, common.savefile(textbox.text)) textbox.text = 'File saved!' except OSError: log.exception('Caught exception during file saving') textbox.text = 'Error writing file!'
def _save_hook(self, textbox: vpython.winput): full_path = common.savefile(textbox.text) try: full_path = common.write_savefile(self._last_state, full_path) textbox.text = f'Saved to {full_path}!' except OSError: log.exception('Caught exception during file saving') textbox.text = f'Error writing file to {full_path}'