From 2f2023968c3aec75ae7b9e39663c5000a64d20ca Mon Sep 17 00:00:00 2001 From: thane98 Date: Sun, 29 Dec 2019 10:08:39 -0600 Subject: [PATCH] Don't clear the dirty flag on save. --- application/services/open_files_service.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/services/open_files_service.py b/application/services/open_files_service.py index 4cd7b8d6..dca096f3 100755 --- a/application/services/open_files_service.py +++ b/application/services/open_files_service.py @@ -78,7 +78,7 @@ def _save_open_files(self): for (path, open_file) in self.open_files.items(): if open_file.dirty: logging.info("Saving " + path + " to filesystem.") - self._try_save_archive(open_file, open_file.file, path) + self._try_save_archive(open_file.file, path) else: logging.info("Skipping " + path + " because it is not dirty.") @@ -87,17 +87,16 @@ def _save_open_message_archive(self): if message_archive.dirty: logging.info("Saving " + path + " to filesystem.") archive = message_archive.to_bin() - self._try_save_archive(message_archive, archive, path, True) + self._try_save_archive(archive, path, True) else: logging.info("Skipping " + path + " because it is not dirty.") - def _try_save_archive(self, source, archive, path, localized=False): + def _try_save_archive(self, archive, path, localized=False): try: if localized: self.filesystem.write_localized_bin("/" + path, archive) else: self.filesystem.write_bin("/" + path, archive) - source.dirty = False except: logging.exception("Failed to save file " + path)