View Issue Details

IDProjectCategoryView StatusLast Update
0000311FreeCADFeaturepublic2011-04-15 06:43
Reporteryorik Assigned Toyorik  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Target Version0.12Fixed in Version0.12 
Summary0000311: add a button to the Report View to switch on/off the redirection of python errors
Descriptionadd a button to the Report View to switch on/off the redirection of python errors
Additional Informationinvolves setting up a new titleBarWidget with a custom button.
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2011-03-30 09:03

administrator   ~0000758

When running a script from within the editor all Python messages (errors, print statements and more) are automatically redirected to the report view. This was done to solve some utf-8 problems we had on Linux.

If you want to redirect python errors from internal python code (e.g. Draft) then the easiest is to add a further menu item to the sub-menu "Options" of the context-menu of the report view and add a slot to implement the exchange. For further infos have a look to ReportOutput::contextMenuEvent(). Just follow the example of "onToggleLogging". Let's say the new slot is onToggleRedirectPython() then look at PythonConsole::runSource() how the redirection is achieved.

yorik

2011-03-30 11:59

administrator   ~0000761

Perfect! Thanks for the info, will save me a lot of time

wmayer

2011-04-15 06:43

administrator   ~0000788

Sorry Yorik for implementing this feature but dvdjimmy needs it now for better script debugging with print statements.

Done in 4414

Issue History

Date Modified Username Field Change
2011-03-16 20:02 yorik New Issue
2011-03-16 20:02 yorik Status new => assigned
2011-03-16 20:02 yorik Assigned To => yorik
2011-03-30 09:03 wmayer Note Added: 0000758
2011-03-30 11:59 yorik Note Added: 0000761
2011-04-15 06:43 wmayer Note Added: 0000788
2011-04-15 06:43 wmayer Status assigned => closed
2011-04-15 06:43 wmayer Resolution open => fixed
2011-04-15 06:43 wmayer Fixed in Version => 0.12