Eidolon
|
Inherits QTextEdit.
Public Member Functions | |
def | __init__ (self, win, conf, parent=None) |
def | sendInputLine (self, line, historyAppend=True) |
def | sendInputBlock (self, block, printBlock=True) |
def | updateLocals (self, localvals) |
def | execute (self, line) |
def | write (self, line) |
def | flush (self) |
def | getCurrentLine (self) |
def | clearCurrentLine (self) |
def | focusOutEvent (self, event) |
def | keyReleaseEvent (self, event) |
def | insertFromMimeData (self, src) |
def | keyPressEvent (self, event) |
Private Member Functions | |
def | _interpretThread (self) |
def | _setCursor (self, startline=False, endline=False) |
Simulates a Python terminal in a QTextEdit widget. This is similar to code.InteractiveConsole in how it executes individual lines of source. It includes a basic session history feature.
def __init__ | ( | self, | |
win, | |||
conf, | |||
parent = None |
|||
) |
|
private |
Daemon thread method which prints the appropriate prompt and reads commands given through sendInputLine(). These are then executed with execute().
|
private |
Set the cursor to the appropriate position, ensuring it is on the last line, after the prompt. If 'startline' is true or the cursor is somewhere not after the last prompt, the cursor is placed just after the last prompt. If 'endline' is true then the cursor goes at the end of the last line.
def clearCurrentLine | ( | self | ) |
Remove the current statement, leaving only the prompt
def execute | ( | self, | |
line | |||
) |
Compile and interpret the given Python statement. Returns true if more statements are expected to fill an indented block, false otherwise.
def flush | ( | self | ) |
Stream compatibility, does nothing.
def focusOutEvent | ( | self, | |
event | |||
) |
def getCurrentLine | ( | self | ) |
Get the current statement being entered, minus the prompt
def insertFromMimeData | ( | self, | |
src | |||
) |
Triggered when pasting text, print out then interpret this line-by-line
def keyPressEvent | ( | self, | |
event | |||
) |
Interpret key presses and move the cursor as necessary. If enter/return is pressed, the current statement is sent to be interpreted. Up and down cycle through the statement history. Usually the method of the superclass is called but this is omitted when preserving correct cursor position for some keys (eg. backspace).
def keyReleaseEvent | ( | self, | |
event | |||
) |
def sendInputBlock | ( | self, | |
block, | |||
printBlock = True |
|||
) |
Send a block of code lines `block' to be interpreted, printing the block to the console if `printBlock'.
def sendInputLine | ( | self, | |
line, | |||
historyAppend = True |
|||
) |
Send the given line to the interpreter's line queue.
def updateLocals | ( | self, | |
localvals | |||
) |
Override the local variable dictionary with the given dictionary.
def write | ( | self, | |
line | |||
) |
Write a line of text to the text window.
comp |
curline |
currentPrompt |
history |
historypos |
initCmds |
inputlines |
isExecuting |
isMetaDown |
linebuffer |
locals |
logfile |
loglines |
metadown |
metakeys |
orig_stderr |
orig_stdout |
ps1 |
ps2 |
thread |
win |