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:
Przemo Firszt 2015-04-14 22:02:21 +01:00 committed by wmayer
parent 2acfadfeef
commit 76aa89b536

View File

@ -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")