This class implements an interactive Python interpreter. More...
#include <PythonConsole.h>
Public Member Functions | |
void | clearBuffer () |
int | compileCommand (const char *) const |
Compile a command and determine whether it is incomplete. More... | |
QStringList | getBuffer () const |
bool | hasPendingInput (void) const |
InteractiveInterpreter () | |
bool | push (const char *) |
Store the line into the internal buffer and compile the total buffer. More... | |
void | setBuffer (const QStringList &) |
~InteractiveInterpreter () | |
This class implements an interactive Python interpreter.
InteractiveInterpreter::InteractiveInterpreter | ( | ) |
References Gui::InteractiveInterpreterP::interpreter.
InteractiveInterpreter::~InteractiveInterpreter | ( | ) |
void InteractiveInterpreter::clearBuffer | ( | ) |
References Gui::InteractiveInterpreterP::buffer.
int InteractiveInterpreter::compileCommand | ( | const char * | source | ) | const |
Compile a command and determine whether it is incomplete.
The source string may contain line feeds and/or carriage returns.
Return value:
(OverflowError and ValueError can be produced by malformed literals).
References Gui::InteractiveInterpreterP::interpreter.
QStringList InteractiveInterpreter::getBuffer | ( | ) | const |
References Gui::InteractiveInterpreterP::buffer.
bool InteractiveInterpreter::hasPendingInput | ( | void | ) | const |
References Gui::InteractiveInterpreterP::buffer.
Referenced by Gui::PythonConsole::keyPressEvent().
bool InteractiveInterpreter::push | ( | const char * | line | ) |
Store the line into the internal buffer and compile the total buffer.
In case it is a complete Python command the buffer is emptied.
References Gui::InteractiveInterpreterP::buffer.
void InteractiveInterpreter::setBuffer | ( | const QStringList & | buf | ) |
References Gui::InteractiveInterpreterP::buffer.