mirror of https://gitlab.com/pamhyr/pamhyr2
Debug: Add exeception.
parent
0aeb2f2530
commit
06de6a3a5b
|
|
@ -70,12 +70,14 @@ class ReplWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self.set_line_edit_text("lineEdit", "")
|
self.set_line_edit_text("lineEdit", "")
|
||||||
self._history_ind = 0
|
self._history_ind = 0
|
||||||
|
|
||||||
code = "self.__debug_exec_result__ = " + code
|
rich_code = "self.__debug_exec_result__ = " + code
|
||||||
print(f"[DEBUG] ! {code}")
|
print(f"[DEBUG] ! {code}")
|
||||||
value = exec(code)
|
try:
|
||||||
value = self.__debug_exec_result__
|
value = exec(rich_code)
|
||||||
|
value = self.__debug_exec_result__
|
||||||
|
except Exception as e:
|
||||||
|
value = f"<font color=\"red\">" + str(e) + "</font>"
|
||||||
|
|
||||||
msg = f"<font color=\"grey\"> # " + code + " #</font>"
|
msg = f"<font color=\"grey\"> # " + code + " #</font>"
|
||||||
self.find(QTextEdit, "textEdit").append(msg)
|
self.find(QTextEdit, "textEdit").append(msg)
|
||||||
|
|
||||||
self.find(QTextEdit, "textEdit").append(str(value))
|
self.find(QTextEdit, "textEdit").append(str(value))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue