diff --git a/lib/caditem.py b/lib/caditem.py index e7233d9..c27189a 100644 --- a/lib/caditem.py +++ b/lib/caditem.py @@ -885,6 +885,7 @@ class CadItem(DataModel): ret = False if re.findall(r'1 out of 1', content): + os.remove(path) self.message_info('Preparation sucessful', 'preparation_sucessful', {'path':impf_pfad}) ret = True elif re.findall(r'Error', content): @@ -894,7 +895,8 @@ class CadItem(DataModel): if not ret: log_editor = os.environ.get(r'LOG_EDITOR') subprocess.run(f"{log_editor} {path}") - shutil.move(path, self._controller.get_env('log')) + if os.path.exists(path): + shutil.move(path, self._controller.get_env('log')) return ret