eric3.QScintilla.Shell

Module implementing a graphical Python shell.

Classes

Shell Module implementing a graphical Python shell.

Functions

None


Shell

Module implementing a graphical Python shell.

A user can enter commands that are executed in the remote Python interpreter.

Derived from

QextScintillaCompat

Methods

Shell Constructor
bindLexer Private slot to set the lexer.
clearCurrentLine Private method to clear the line containing the cursor.
closeShell Public method to shutdown the shell.
contextMenuEvent Reimplemented to show our own context menu.
dragEnterEvent Protected method to handle the drag enter event.
dragLeaveEvent Protected method to handle the drag leave event.
dragMoveEvent Protected method to handle the drag move event.
dropEvent Protected method to handle the drop event.
editorCommand Public method to perform an editor command.
eventFilter Protected method to handle some event on behalve of our componentes.
executeCommand Private slot to execute a command.
executeLines Private method to execute a set of lines as multiple commands.
focusInEvent Public method called when the shell receives focus.
focusNextPrevChild Reimplemented to stop Tab moving to the next window.
focusOutEvent Public method called when the shell loses focus.
getBanner Private method to get the banner for the remote interpreter.
getClientType Public slot to get the clients type.
getEndPos Private method to return the line and column of the last character.
handleClear Private slot to handle the 'clear' context menu entry.
handleClientCapabilities Private slot to handle the reporting of the clients capabilities.
handleClientError Private method to handle an error in the client.
handleClientStatement Private method to handle the response from the debugger client.
handleCompletionList Private slot to handle the selection from the completion list.
handleMiddleButton Private method to handle the middle mouse button press.
handlePreferencesChanged Public slot to handle the preferencesChanged signal.
handleQScintillaAutoCompletionCommand Private method to handle a command for autocompletion only.
handleQScintillaCharLeft Private method to handle the Cursor Left command.
handleQScintillaCharLeftExtend Private method to handle the Extend Selection Left command.
handleQScintillaDelete Private method to handle the delete command.
handleQScintillaDeleteBack Private method to handle the Backspace key.
handleQScintillaDeleteLineLeft Private method to handle the Delete Line Left command.
handleQScintillaDeleteWordLeft Private method to handle the Delete Word Left command.
handleQScintillaLeftCommand Private method to handle a QScintilla command working to the left.
handleQScintillaLeftDeleteCommand Private method to handle a QScintilla delete command working to the left.
handleQScintillaLineDown Private method to handle the Down key.
handleQScintillaLineEnd Private method to handle the End key.
handleQScintillaLineUp Private method to handle the Up key.
handleQScintillaNewline Private method to handle the Return key.
handleQScintillaTab Private method to handle the Tab key.
handleQScintillaVCHome Private method to handle the Home key.
handleQScintillaVCHomeExtend Private method to handle the Extend Selection to start of line command.
handleQScintillaWordLeft Private method to handle the Cursor Word Left command.
handleQScintillaWordLeftExtend Private method to handle the Extend Selection Left one word command.
handleReset Private slot to handle the 'reset' context menu entry.
handleResetAndClear Private slot to handle the 'reset and clear' context menu entry.
handleStartPython Private slot to handle the 'Start Python' context menu entry.
handleStartRuby Private slot to handle the 'Start Ruby' context menu entry.
initialise Private method to get ready for a new remote interpreter.
insert Public slot to insert text at the current cursor position.
insertText Private method to insert some text at the current cursor position.
insertTextAtEnd Private method to insert some text at the end of the command line.
insertTextNoEcho Private method to insert some text at the end of the buffer without echoing it.
keyPressEvent Re-implemented to handle the user input a key at a time.
mousePress Re-implemented to handle the press of the left and middle button specially.
paste Reimplemented slot to handle the paste action.
raw_input Private method to handle raw input.
rsearchHistory Private method used to reverse search the history.
searchHistory Private method used to search the history.
setAutoCompletion Private method to configure the autocompletion function.
setCallTips Private method to configure the calltips function.
setMargin0 Private method to configure margins 0.
setTextDisplay Private method to configure the text display.
showCompletions Private method to display the possible completions.
useHistory Private method to display a command from the history.
write Private method to display some text.
writeBanner Private method to write a banner with info from the debug client.

Shell (Constructor)

Shell(dbs, vm, parent=None)

Constructor

dbs
reference to the debug server object
vm
reference to the viewmanager object
parent
parent widget (QWidget)

Shell.bindLexer

bindLexer(language = 'Python')

Private slot to set the lexer.

language
lexer language to set

Shell.clearCurrentLine

clearCurrentLine()

Private method to clear the line containing the cursor.

Shell.closeShell

closeShell()

Public method to shutdown the shell.

Shell.contextMenuEvent

contextMenuEvent(ev)

Reimplemented to show our own context menu.

ev
context menu event (QContextMenuEvent)

Shell.dragEnterEvent

dragEnterEvent(event)

Protected method to handle the drag enter event.

event
the drag enter event (QDragEnterEvent)

Shell.dragLeaveEvent

dragLeaveEvent(event)

Protected method to handle the drag leave event.

event
the drag leave event (QDragLeaveEvent)

Shell.dragMoveEvent

dragMoveEvent(event)

Protected method to handle the drag move event.

event
the drag move event (QDragMoveEvent)

Shell.dropEvent

dropEvent(event)

Protected method to handle the drop event.

event
the drop event (QDropEvent)

Shell.editorCommand

editorCommand(cmd)

Public method to perform an editor command.

cmd
the scintilla command to be performed

Shell.eventFilter

eventFilter(obj, evt)

Protected method to handle some event on behalve of our componentes.

obj
destination object of the event (QObject)
evt
the event to be handled (QEvent)
Returns:
flag to indicate, if the event was handled

Shell.executeCommand

executeCommand(cmd)

Private slot to execute a command.

cmd
command to be executed by debug client (string)

Shell.executeLines

executeLines(lines)

Private method to execute a set of lines as multiple commands.

lines
multiple lines of text to be executed as single commands (string)

Shell.focusInEvent

focusInEvent(event)

Public method called when the shell receives focus.

event
the event object (QFocusEvent)

Shell.focusNextPrevChild

focusNextPrevChild(next)

Reimplemented to stop Tab moving to the next window.

While the user is entering a multi-line command, the movement to the next window by the Tab key being pressed is suppressed.

next
next window
Returns:
flag indicating the movement

Shell.focusOutEvent

focusOutEvent(event)

Public method called when the shell loses focus.

event
the event object (QFocusEvent)

Shell.getBanner

getBanner()

Private method to get the banner for the remote interpreter.

It requests the Python version and platform running on the debug client side.

Shell.getClientType

getClientType()

Public slot to get the clients type.

Returns:
client type (string)

Shell.getEndPos

getEndPos()

Private method to return the line and column of the last character.

Returns:
tuple of two values (int, int) giving the line and column

Shell.handleClear

handleClear()

Private slot to handle the 'clear' context menu entry.

Shell.handleClientCapabilities

handleClientCapabilities(cap, clType)

Private slot to handle the reporting of the clients capabilities.

cap
client capabilities (integer)
clType
type of the debug client (string)

Shell.handleClientError

handleClientError()

Private method to handle an error in the client.

Shell.handleClientStatement

handleClientStatement(more)

Private method to handle the response from the debugger client.

more
flag indicating that more user input is required

Shell.handleCompletionList

handleCompletionList(txt, id)

Private slot to handle the selection from the completion list.

txt
the selected text (QString)
id
the ID of the user list (should be 1) (integer)

Shell.handleMiddleButton

handleMiddleButton()

Private method to handle the middle mouse button press.

Shell.handlePreferencesChanged

handlePreferencesChanged()

Public slot to handle the preferencesChanged signal.

Shell.handleQScintillaAutoCompletionCommand

handleQScintillaAutoCompletionCommand(cmd)

Private method to handle a command for autocompletion only.

cmd
QScintilla command

Shell.handleQScintillaCharLeft

handleQScintillaCharLeft()

Private method to handle the Cursor Left command.

Shell.handleQScintillaCharLeftExtend

handleQScintillaCharLeftExtend()

Private method to handle the Extend Selection Left command.

Shell.handleQScintillaDelete

handleQScintillaDelete()

Private method to handle the delete command.

Shell.handleQScintillaDeleteBack

handleQScintillaDeleteBack()

Private method to handle the Backspace key.

Shell.handleQScintillaDeleteLineLeft

handleQScintillaDeleteLineLeft()

Private method to handle the Delete Line Left command.

Shell.handleQScintillaDeleteWordLeft

handleQScintillaDeleteWordLeft()

Private method to handle the Delete Word Left command.

Shell.handleQScintillaLeftCommand

handleQScintillaLeftCommand(method)

Private method to handle a QScintilla command working to the left.

method
shell method to execute

Shell.handleQScintillaLeftDeleteCommand

handleQScintillaLeftDeleteCommand(method)

Private method to handle a QScintilla delete command working to the left.

method
shell method to execute

Shell.handleQScintillaLineDown

handleQScintillaLineDown(cmd)

Private method to handle the Down key.

cmd
QScintilla command

Shell.handleQScintillaLineEnd

handleQScintillaLineEnd(cmd)

Private method to handle the End key.

cmd
QScintilla command

Shell.handleQScintillaLineUp

handleQScintillaLineUp(cmd)

Private method to handle the Up key.

cmd
QScintilla command

Shell.handleQScintillaNewline

handleQScintillaNewline(cmd)

Private method to handle the Return key.

cmd
QScintilla command

Shell.handleQScintillaTab

handleQScintillaTab(cmd)

Private method to handle the Tab key.

cmd
QScintilla command

Shell.handleQScintillaVCHome

handleQScintillaVCHome(cmd)

Private method to handle the Home key.

cmd
QScintilla command

Shell.handleQScintillaVCHomeExtend

handleQScintillaVCHomeExtend()

Private method to handle the Extend Selection to start of line command.

Shell.handleQScintillaWordLeft

handleQScintillaWordLeft()

Private method to handle the Cursor Word Left command.

Shell.handleQScintillaWordLeftExtend

handleQScintillaWordLeftExtend()

Private method to handle the Extend Selection Left one word command.

Shell.handleReset

handleReset()

Private slot to handle the 'reset' context menu entry.

Shell.handleResetAndClear

handleResetAndClear()

Private slot to handle the 'reset and clear' context menu entry.

Shell.handleStartPython

handleStartPython()

Private slot to handle the 'Start Python' context menu entry.

Shell.handleStartRuby

handleStartRuby()

Private slot to handle the 'Start Ruby' context menu entry.

Shell.initialise

initialise()

Private method to get ready for a new remote interpreter.

Shell.insert

insert(text)

Public slot to insert text at the current cursor position.

The cursor is advanced to the end of the inserted text.

text
text to be inserted (string or QString)

Shell.insertText

insertText(s)

Private method to insert some text at the current cursor position.

s
text to be inserted (string or QString)

Shell.insertTextAtEnd

insertTextAtEnd(s)

Private method to insert some text at the end of the command line.

s
text to be inserted (string or QString)

Shell.insertTextNoEcho

insertTextNoEcho(s)

Private method to insert some text at the end of the buffer without echoing it.

s
text to be inserted (string or QString)

Shell.keyPressEvent

keyPressEvent(ev)

Re-implemented to handle the user input a key at a time.

ev
key event (QKeyPressEvent)

Shell.mousePress

mousePress(ev)

Re-implemented to handle the press of the left and middle button specially.

ev
key event (QMouseEvent)

Shell.paste

paste()

Reimplemented slot to handle the paste action.

Shell.raw_input

raw_input(s, echo)

Private method to handle raw input.

s
prompt to be displayed (string or QString)
echo
Flag indicating echoing of the input (boolean)

Shell.rsearchHistory

rsearchHistory(txt, startIdx=-1)

Private method used to reverse search the history.

txt
text to match at the beginning (string or QString)
startIdx
index to start search from (integer)
Returns:
index of

Shell.searchHistory

searchHistory(txt, startIdx=-1)

Private method used to search the history.

txt
text to match at the beginning (string or QString)
startIdx
index to start search from (integer)
Returns:
index of

Shell.setAutoCompletion

setAutoCompletion(language = 'Python')

Private method to configure the autocompletion function.

language
of the autocompletion set to set

Shell.setCallTips

setCallTips(language = 'Python')

Private method to configure the calltips function.

language
of the calltips set to set

Shell.setMargin0

setMargin0()

Private method to configure margins 0.

Shell.setTextDisplay

setTextDisplay()

Private method to configure the text display.

Shell.showCompletions

showCompletions(completions, text)

Private method to display the possible completions.

Shell.useHistory

useHistory()

Private method to display a command from the history.

Shell.write

write(s)

Private method to display some text.

s
text to be displayed (string or QString)

Shell.writeBanner

writeBanner(version, platform, dbgclient)

Private method to write a banner with info from the debug client.

version
Python version string (string)
platform
platform of the remote interpreter (string)
dbgclient
debug client variant used (string)

Up