Mantid
|
The CodeExecution class support execution of arbitrary Python code with the option to install a trace handler to track lines executed and tell an editor to mark them appropriately. More...
#include <CodeExecution.h>
Public Member Functions | |
CodeExecution (ScriptEditor *editor) | |
Construct a LineTrackingExecutor for a given editor. More... | |
PyObject * | execute (const QString &codeStr, const QString &filename, int flags, PyObject *globals, int lineOffset) const |
Execute the code string from the given filename and return the result. More... | |
Private Attributes | |
ScriptEditor * | m_editor {nullptr} |
The CodeExecution class support execution of arbitrary Python code with the option to install a trace handler to track lines executed and tell an editor to mark them appropriately.
Definition at line 22 of file CodeExecution.h.
MantidQt::Widgets::Common::Python::CodeExecution::CodeExecution | ( | ScriptEditor * | editor | ) |
Construct a LineTrackingExecutor for a given editor.
editor | A pointer to an editor. Can be nullptr. Disables progress tracking. |
Definition at line 61 of file CodeExecution.cpp.
PyObject * MantidQt::Widgets::Common::Python::CodeExecution::execute | ( | const QString & | codeStr, |
const QString & | filename, | ||
int | flags, | ||
PyObject * | globals, | ||
int | lineOffset | ||
) | const |
Execute the code string from the given filename and return the result.
codeStr | A string containing the source code |
filename | A string containing the filename of the source code |
flags | An OR-ed combination of compiler flags |
globals | A dictionary containing the current globals mapping |
lineOffset | The number of lines offset to apply to the marker |
Definition at line 71 of file CodeExecution.cpp.
References CODE_OBJECT, and m_editor.
|
private |
Definition at line 29 of file CodeExecution.h.
Referenced by execute().