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 () | |
Detailed Description
This class implements an interactive Python interpreter.
Constructor & Destructor Documentation
◆ InteractiveInterpreter()
InteractiveInterpreter::InteractiveInterpreter | ( | ) |
References Gui::InteractiveInterpreterP::interpreter.
◆ ~InteractiveInterpreter()
InteractiveInterpreter::~InteractiveInterpreter | ( | ) |
Member Function Documentation
◆ clearBuffer()
void InteractiveInterpreter::clearBuffer | ( | ) |
References Gui::InteractiveInterpreterP::buffer.
◆ compileCommand()
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:
- Return 1 if the command is incomplete
- Return 0 if the command is complete and valid
- Return -1 if the command is a syntax error
(OverflowError and ValueError can be produced by malformed literals).
References Gui::InteractiveInterpreterP::interpreter.
◆ getBuffer()
QStringList InteractiveInterpreter::getBuffer | ( | ) | const |
References Gui::InteractiveInterpreterP::buffer.
◆ hasPendingInput()
bool InteractiveInterpreter::hasPendingInput | ( | void | ) | const |
References Gui::InteractiveInterpreterP::buffer.
Referenced by Gui::PythonConsole::keyPressEvent().
◆ push()
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.
◆ setBuffer()
void InteractiveInterpreter::setBuffer | ( | const QStringList & | buf | ) |
References Gui::InteractiveInterpreterP::buffer.
The documentation for this class was generated from the following files:
- src/Gui/PythonConsole.h
- src/Gui/PythonConsole.cpp