SolverLogFileWindow: Add exeption to fix crash for #48.

dev_dylan
Pierre-Antoine 2026-05-26 16:36:27 +02:00
parent fb8b5aa77f
commit c3faf45f75
1 changed files with 20 additions and 14 deletions

View File

@ -20,7 +20,7 @@ import tempfile
import os
from queue import Queue
from tools import trace, timer
from tools import trace, timer, logger_exception
from View.Tools.PamhyrWindow import PamhyrDialog, PamhyrWindow
@ -81,16 +81,20 @@ class SolverLogFileWindow(PamhyrWindow):
self.open_on_editor)
def setup_text(self):
try:
with open(self._file_name, "r") as f:
for line in f:
line = line.rstrip()
self.find(QTextEdit, "textEdit").append(line)
except Exception as e:
logger_exception(e)
def revert(self):
self.find(QTextEdit, "textEdit").clear()
self.setup_text()
def open_on_editor(self):
try:
p = QProcess(self)
cmd = self._config.editor
@ -103,3 +107,5 @@ class SolverLogFileWindow(PamhyrWindow):
p.start(
exe, args,
)
except Exception as e:
logger_exception(e)