Improve scripter's exception reporting.
Currently scripter posts a critical QMessage box containing the error text
relating to an exception, but it does not provide the line number or text
where the exception occurred. This requires someone scripting to close the
message box before correcting the issue.
For syntax errors and indent errors it will provide the line number but not
(in the case of syntax errors) any visual indication of the location of the
syntax error.
This diff takes exception handling into runaction.py and provides exception
reporting in the output widget. This removes the dialog box, so script
developers don't need to constantly close a dialog box to edit and rerun their
script. The reporting is minimal, effectively limited to one traceback.
For syntax errors it shows the location of the error.
For example, the code
# Syntax error - progressively uncomment each test
for a in range(15)
print(a)
Should produce the output:
#**********************
#Syntax Error on line 2
#for a in range(15)
# ^
#************
(Only the caret will be correctly positioned, because it'll be shown using a monospaced font...)
For this part of the syntax error reporting to work properly requires that the
output widget uses a monospace font - see https://phabricator.kde.org/D9530
This diff assumes the following revisions have been implemented:
https://phabricator.kde.org/D9527
https://phabricator.kde.org/D9529
https://phabricator.kde.org/D9530