FEM: Catch ccx errors and print to FEM console in red
Code by wmayer http://forum.freecadweb.org/viewtopic.php?f=18&t=10514&p=84921#p84901
This commit is contained in:
parent
2acfadfeef
commit
76aa89b536
|
@ -259,6 +259,13 @@ class _JobControlTaskPanel:
|
|||
else:
|
||||
try:
|
||||
out = unicode(out, 'utf-8')
|
||||
rx = QtCore.QRegExp("\\*ERROR.*\\n\\n")
|
||||
rx.setMinimal(True)
|
||||
pos = rx.indexIn(out)
|
||||
while not pos < 0:
|
||||
match = rx.cap(0)
|
||||
FreeCAD.Console.PrintError(match.strip().replace('\n',' ') + '\n')
|
||||
pos = rx.indexIn(out, pos + 1)
|
||||
self.femConsoleMessage(out.replace('\n','<br>'))
|
||||
except UnicodeDecodeError:
|
||||
self.femConsoleMessage("Error converting stdout from CalculiX", "#FF0000")
|
||||
|
|
Loading…
Reference in New Issue
Block a user