Home ⌂Doc Index ◂Up ▴

eric6.QScintilla.Shell

Module implementing a graphical Python shell.

Global Attributes

None

Classes

Shell Class implementing a graphical Python shell.
ShellAssembly Class implementing the containing widget for the shell.
ShellHistoryStyle Class defining the shell history styles.

Functions

None


Shell

Class implementing a graphical Python shell.

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

Signals

historyStyleChanged(ShellHistoryStyle)
emitted to indicate a change of the history style
queueText(str)
emitted to queue some text for processing
searchStringFound(bool)
emitted to indicate the search result
virtualEnvironmentChanged(str)
emitted to signal the new virtual environment of the shell

Derived from

QsciScintillaCompat

Class Attributes

None

Class Methods

None

Methods

Shell Constructor
__QScintillaAutoCompletionCommand Private method to handle a command for autocompletion only.
__QScintillaCancel Private method to handle the ESC command.
__QScintillaCharLeft Private method to handle the Cursor Left command.
__QScintillaCharLeftExtend Private method to handle the Extend Selection Left command.
__QScintillaCharRight Private method to handle the Cursor Right command.
__QScintillaCommand Private method to send the command to QScintilla.
__QScintillaCursorCommand Private method to handle the cursor commands.
__QScintillaDelete Private method to handle the delete command.
__QScintillaDeleteBack Private method to handle the Backspace key.
__QScintillaDeleteLineLeft Private method to handle the Delete Line Left command.
__QScintillaDeleteLineRight Private method to handle the Delete Line Right command.
__QScintillaDeleteWordLeft Private method to handle the Delete Word Left command.
__QScintillaDeleteWordRight Private method to handle the Delete Word Right command.
__QScintillaHistoryDown Private method to handle the history down command.
__QScintillaHistoryUp Private method to handle the history up command.
__QScintillaLeftCommand Private method to handle a QScintilla command working to the left.
__QScintillaLeftDeleteCommand Private method to handle a QScintilla delete command working to the left.
__QScintillaLineDown Private method to handle the cursor down command.
__QScintillaLineEnd Private method to handle the End key.
__QScintillaLineUp Private method to handle the cursor up command.
__QScintillaNewline Private method to handle the Return key.
__QScintillaRightCommand Private method to handle a QScintilla command working to the right.
__QScintillaTab Private method to handle the Tab key.
__QScintillaVCHome Private method to handle the Home key.
__QScintillaVCHomeExtend Private method to handle the Extend Selection to start of line command.
__QScintillaWordLeft Private method to handle the Cursor Word Left command.
__QScintillaWordLeftExtend Private method to handle the Extend Selection Left one word command.
__QScintillaWordRight Private method to handle the Cursor Word Right command.
__bindLexer Private slot to set the lexer.
__clearCurrentLine Private method to clear the line containing the cursor.
__clientCapabilities Private slot to handle the reporting of the clients capabilities.
__clientError Private method to handle an error in the client.
__clientException Private method to handle an exception of the client.
__clientSignal Private method to handle a signal generated on the client side.
__clientStatement Private method to handle the response from the debugger client.
__clientSyntaxError Private method to handle a syntax error in the debugged program.
__completionListSelected Private slot to handle the selection from the completion list.
__concatenateText Private slot to queue text and process it in one step.
__configure Private method to open the configuration dialog.
__executeCommand Private slot to execute a command.
__find Private slot to show the find widget.
__flushQueuedText Private slot to flush the accumulated text output.
__getBanner Private method to get the banner for the remote interpreter.
__getEndPos Private method to return the line and column of the last character.
__indentLength Private method to determine the indentation length of the given line.
__initialise Private method to get ready for a new remote interpreter.
__insertHistory Private method to insert a command selected from the history.
__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.
__isCursorOnLastLine Private method to check, if the cursor is on the last line.
__isHistoryIndexValid Private method to test, if the history index is valid.
__middleMouseButton Private method to handle the middle mouse button press.
__projectClosed Private slot to restart the default shell when the project is closed.
__projectOpened Private slot to start the shell for the opened project.
__raw_input Private method to handle raw input.
__resetIncrementalHistorySearch Private method to reset the incremental history search.
__resizeLinenoMargin Private slot to resize the line numbers margin.
__rsearchHistory Private method used to reverse search the history.
__searchHistory Private method used to search the history.
__searchNext Private method to search for the next occurrence.
__searchPrev Private method to search for the next occurrence.
__setAutoCompletion Private method to configure the autocompletion function.
__setCallTips Private method to configure the calltips function.
__setHistoryIndex Private method to set the initial history index.
__setMargin0 Private method to configure margin 0.
__setMonospaced Private method to set/reset a monospaced font.
__setTextDisplay Private method to configure the text display.
__showCompletions Private method to display the possible completions.
__showStartMenu Private slot to prepare the start submenu.
__showVenvName Private method to show the name of the active virtual environment.
__startDebugClient Private slot to start a debug client according to the action triggered.
__useHistory Private method to display a command from the history.
__write Private method to display some text without queuing.
__writeBanner Private method to write a banner with info from the debug client.
__writePrompt Private method to write the prompt using a write queue.
__writeQueued Private method to display some text using a write queue.
__writeStdErr Private method to display some text with StdErr label.
__writeStdOut Private method to display some text with StdOut label.
clear Public slot to clear the display.
clearAllHistories Public method to clear all available histories and sync them.
clearHistory Public slot to clear the current history.
closeShell Public method to shutdown the shell.
contextMenuEvent Protected method to show our own context menu.
doClearRestart Public slot to handle the 'restart and clear' context menu entry.
doRestart Public slot to handle the 'restart' context menu entry.
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.
event Public method handling events.
executeLines Public method to execute a set of lines as multiple commands.
focusInEvent Protected method called when the shell receives focus.
focusNextPrevChild Public method to stop Tab moving to the next window.
focusOutEvent Protected method called when the shell loses focus.
gestureEvent Protected method handling gesture events.
getClientType Public slot to get the clients type.
getHistory Public method to get the history for the given client type.
getHistoryIndex Public method to get the current value of the history index.
handlePreferencesChanged Public slot to handle the preferencesChanged signal.
historyStyle Public method to get the shell history style.
insert Public slot to insert text at the current cursor position.
isHistoryEnabled Public method to check, if the history is enabled.
keyPressEvent Protected method to handle the user input a key at a time.
loadHistory Public method to load the history for the given client type.
mousePressEvent Protected method to handle the mouse press event.
paste Public slot to handle the paste action.
reloadHistory Public method to reload the history of the currently selected client type.
saveHistory Public method to save the history for the given client type.
searchNext Public method to search the next occurrence of the given text.
searchPrev Public method to search the previous occurrence of the given text.
selectHistory Public slot to select a history entry to execute.
setDebuggerUI Public method to set the debugger UI.
showHistory Public slot to show the shell history dialog.
wheelEvent Protected method to handle wheel events.

Static Methods

None

Shell (Constructor)

Shell(dbs, vm, project, windowedVariant, parent=None)

Constructor

dbs (DebugServer)
reference to the debug server object
vm (ViewManager)
reference to the viewmanager object
project (Project)
reference to the project object
windowedVariant (bool)
flag indicating the shell window variant
parent (QWidget)
parent widget

Shell.__QScintillaAutoCompletionCommand

__QScintillaAutoCompletionCommand(cmd)

Private method to handle a command for autocompletion only.

cmd
QScintilla command

Shell.__QScintillaCancel

__QScintillaCancel()

Private method to handle the ESC command.

Shell.__QScintillaCharLeft

__QScintillaCharLeft()

Private method to handle the Cursor Left command.

Shell.__QScintillaCharLeftExtend

__QScintillaCharLeftExtend()

Private method to handle the Extend Selection Left command.

Shell.__QScintillaCharRight

__QScintillaCharRight()

Private method to handle the Cursor Right command.

Shell.__QScintillaCommand

__QScintillaCommand(cmd)

Private method to send the command to QScintilla.

cmd
QScintilla command

Shell.__QScintillaCursorCommand

__QScintillaCursorCommand(cmd)

Private method to handle the cursor commands.

cmd
QScintilla command

Shell.__QScintillaDelete

__QScintillaDelete()

Private method to handle the delete command.

Shell.__QScintillaDeleteBack

__QScintillaDeleteBack()

Private method to handle the Backspace key.

Shell.__QScintillaDeleteLineLeft

__QScintillaDeleteLineLeft()

Private method to handle the Delete Line Left command.

Shell.__QScintillaDeleteLineRight

__QScintillaDeleteLineRight()

Private method to handle the Delete Line Right command.

Shell.__QScintillaDeleteWordLeft

__QScintillaDeleteWordLeft()

Private method to handle the Delete Word Left command.

Shell.__QScintillaDeleteWordRight

__QScintillaDeleteWordRight()

Private method to handle the Delete Word Right command.

Shell.__QScintillaHistoryDown

__QScintillaHistoryDown(cmd)

Private method to handle the history down command.

cmd
QScintilla command

Shell.__QScintillaHistoryUp

__QScintillaHistoryUp(cmd)

Private method to handle the history up command.

cmd
QScintilla command

Shell.__QScintillaLeftCommand

__QScintillaLeftCommand(method, allLinesAllowed=False)

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

method
shell method to execute
allLinesAllowed
flag indicating that the command may be executed on any line (boolean)

Shell.__QScintillaLeftDeleteCommand

__QScintillaLeftDeleteCommand(method)

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

method
shell method to execute

Shell.__QScintillaLineDown

__QScintillaLineDown(cmd)

Private method to handle the cursor down command.

cmd
QScintilla command

Shell.__QScintillaLineEnd

__QScintillaLineEnd(cmd)

Private method to handle the End key.

cmd
QScintilla command

Shell.__QScintillaLineUp

__QScintillaLineUp(cmd)

Private method to handle the cursor up command.

cmd
QScintilla command

Shell.__QScintillaNewline

__QScintillaNewline(cmd)

Private method to handle the Return key.

cmd
QScintilla command

Shell.__QScintillaRightCommand

__QScintillaRightCommand(method)

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

method
shell method to execute

Shell.__QScintillaTab

__QScintillaTab(cmd)

Private method to handle the Tab key.

cmd
QScintilla command

Shell.__QScintillaVCHome

__QScintillaVCHome(cmd)

Private method to handle the Home key.

cmd
QScintilla command

Shell.__QScintillaVCHomeExtend

__QScintillaVCHomeExtend()

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

Shell.__QScintillaWordLeft

__QScintillaWordLeft()

Private method to handle the Cursor Word Left command.

Shell.__QScintillaWordLeftExtend

__QScintillaWordLeftExtend()

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

Shell.__QScintillaWordRight

__QScintillaWordRight()

Private method to handle the Cursor Word Right command.

Shell.__bindLexer

__bindLexer(language='Python3')

Private slot to set the lexer.

language
lexer language to set (string)

Shell.__clearCurrentLine

__clearCurrentLine()

Private method to clear the line containing the cursor.

Shell.__clientCapabilities

__clientCapabilities(cap, clType, venvName)

Private slot to handle the reporting of the clients capabilities.

cap (int)
client capabilities
clType (str)
type of the debug client
venvName (str)
name of the virtual environment

Shell.__clientError

__clientError()

Private method to handle an error in the client.

Shell.__clientException

__clientException(exceptionType, exceptionMessage, stackTrace)

Private method to handle an exception of the client.

exceptionType
type of exception raised (string)
exceptionMessage
message given by the exception (string)
stackTrace
list of stack entries (list of string)

Shell.__clientSignal

__clientSignal(message, filename, lineNo, funcName, funcArgs)

Private method to handle a signal generated on the client side.

message (str)
message of the syntax error
filename (str)
translated filename of the syntax error position
lineNo (int)
line number of the syntax error position
funcName (str)
name of the function causing the signal
funcArgs (str)
function arguments

Shell.__clientStatement

__clientStatement(more)

Private method to handle the response from the debugger client.

more
flag indicating that more user input is required (boolean)

Shell.__clientSyntaxError

__clientSyntaxError(message, filename, lineNo, characterNo)

Private method to handle a syntax error in the debugged program.

message
message of the syntax error (string)
filename
translated filename of the syntax error position (string)
lineNo
line number of the syntax error position (integer)
characterNo
character number of the syntax error position (integer)

Shell.__completionListSelected

__completionListSelected(listId, txt)

Private slot to handle the selection from the completion list.

listId
the ID of the user list (should be 1) (integer)
txt
the selected text (string)

Shell.__concatenateText

__concatenateText(text)

Private slot to queue text and process it in one step.

text (str)
text to be appended

Shell.__configure

__configure()

Private method to open the configuration dialog.

Shell.__executeCommand

__executeCommand(cmd, historyIndex=None)

Private slot to execute a command.

cmd (str)
command to be executed by debug client
historyIndex (int)
history index to be set

Shell.__find

__find()

Private slot to show the find widget.

Shell.__flushQueuedText

__flushQueuedText()

Private slot to flush the accumulated text output.

Shell.__getBanner

__getBanner()

Private method to get the banner for the remote interpreter.

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

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.__indentLength

__indentLength(line)

Private method to determine the indentation length of the given line.

line (str)
line to determine the indentation length for
Returns:
indentation length
Return Type:
int

Shell.__initialise

__initialise()

Private method to get ready for a new remote interpreter.

Shell.__insertHistory

__insertHistory(cmd)

Private method to insert a command selected from the history.

cmd
history entry to be inserted (string)

Shell.__insertText

__insertText(s)

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

s
text to be inserted (string)

Shell.__insertTextAtEnd

__insertTextAtEnd(s)

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

s
text to be inserted (string)

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)

Shell.__isCursorOnLastLine

__isCursorOnLastLine()

Private method to check, if the cursor is on the last line.

Returns:
flag indicating that the cursor is on the last line (boolean)

Shell.__isHistoryIndexValid

__isHistoryIndexValid()

Private method to test, if the history index is valid.

Returns:
flag indicating validity
Return Type:
bool

Shell.__middleMouseButton

__middleMouseButton()

Private method to handle the middle mouse button press.

Shell.__projectClosed

__projectClosed()

Private slot to restart the default shell when the project is closed.

Shell.__projectOpened

__projectOpened()

Private slot to start the shell for the opened project.

Shell.__raw_input

__raw_input(prompt, echo)

Private method to handle raw input.

prompt (str)
prompt to be displayed
echo (bool)
Flag indicating echoing of the input

Shell.__resetIncrementalHistorySearch

__resetIncrementalHistorySearch()

Private method to reset the incremental history search.

Shell.__resizeLinenoMargin

__resizeLinenoMargin()

Private slot to resize the line numbers margin.

Shell.__rsearchHistory

__rsearchHistory(txt, startIdx=-1)

Private method used to reverse search the history.

txt (str)
text to match at the beginning
startIdx (int)
index to start search from
Returns:
tuple containing the index of found entry and a flag indicating that something was found
Return Type:
tuple of (int, bool)

Shell.__searchHistory

__searchHistory(txt, startIdx=-1)

Private method used to search the history.

txt (str)
text to match at the beginning
startIdx (int)
index to start search from
Returns:
tuple containing the index of found entry and a flag indicating that something was found
Return Type:
tuple of (int, bool)

Shell.__searchNext

__searchNext()

Private method to search for the next occurrence.

Shell.__searchPrev

__searchPrev()

Private method to search for the next occurrence.

Shell.__setAutoCompletion

__setAutoCompletion(language='Python')

Private method to configure the autocompletion function.

language
of the autocompletion set to set (string)

Shell.__setCallTips

__setCallTips(language='Python')

Private method to configure the calltips function.

language
of the calltips set to set (string)

Shell.__setHistoryIndex

__setHistoryIndex(index=None)

Private method to set the initial history index.

index (int or None)
index value to be set

Shell.__setMargin0

__setMargin0()

Private method to configure margin 0.

Shell.__setMonospaced

__setMonospaced(on)

Private method to set/reset a monospaced font.

on
flag to indicate usage of a monospace font (boolean)

Shell.__setTextDisplay

__setTextDisplay()

Private method to configure the text display.

Shell.__showCompletions

__showCompletions(completions, text)

Private method to display the possible completions.

completions
list of possible completions (list of strings)
text
text that is about to be completed (string)

Shell.__showStartMenu

__showStartMenu()

Private slot to prepare the start submenu.

Shell.__showVenvName

__showVenvName()

Private method to show the name of the active virtual environment.

Shell.__startDebugClient

__startDebugClient(action)

Private slot to start a debug client according to the action triggered.

action
context menu action that was triggered (QAction)

Shell.__useHistory

__useHistory()

Private method to display a command from the history.

Shell.__write

__write(s)

Private method to display some text without queuing.

s (str)
text to be displayed

Shell.__writeBanner

__writeBanner(version, platform, dbgclient, venvName)

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

version (str)
interpreter version string
platform (str)
platform of the remote interpreter
dbgclient (str)
debug client variant used
venvName (str)
name of the virtual environment

Shell.__writePrompt

__writePrompt()

Private method to write the prompt using a write queue.

Shell.__writeQueued

__writeQueued(s)

Private method to display some text using a write queue.

s
text to be displayed (string)

Shell.__writeStdErr

__writeStdErr(s)

Private method to display some text with StdErr label.

s
text to be displayed (string)

Shell.__writeStdOut

__writeStdOut(s)

Private method to display some text with StdOut label.

s
text to be displayed (string)

Shell.clear

clear()

Public slot to clear the display.

Shell.clearAllHistories

clearAllHistories()

Public method to clear all available histories and sync them.

Shell.clearHistory

clearHistory()

Public slot to clear the current history.

Shell.closeShell

closeShell()

Public method to shutdown the shell.

Shell.contextMenuEvent

contextMenuEvent(ev)

Protected method to show our own context menu.

ev
context menu event (QContextMenuEvent)

Shell.doClearRestart

doClearRestart()

Public slot to handle the 'restart and clear' context menu entry.

Shell.doRestart

doRestart()

Public slot to handle the 'restart' context menu entry.

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.event

event(evt)

Public method handling events.

evt
reference to the event (QEvent)
Returns:
flag indicating, if the event was handled (boolean)

Shell.executeLines

executeLines(lines, historyIndex=None)

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

lines (str)
multiple lines of text to be executed as single commands
historyIndex (int)
history index to be set

Shell.focusInEvent

focusInEvent(event)

Protected method called when the shell receives focus.

event
the event object (QFocusEvent)

Shell.focusNextPrevChild

focusNextPrevChild(nextChild)

Public method 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.

nextChild
next window
Returns:
flag indicating the movement

Shell.focusOutEvent

focusOutEvent(event)

Protected method called when the shell loses focus.

event
the event object (QFocusEvent)

Shell.gestureEvent

gestureEvent(evt)

Protected method handling gesture events.

evt
reference to the gesture event (QGestureEvent

Shell.getClientType

getClientType()

Public slot to get the clients type.

Returns:
client type (string)

Shell.getHistory

getHistory(clientType)

Public method to get the history for the given client type.

clientType
type of the debug client (string). If it is None, the current history is returned.
Returns:
reference to the history list (list of strings)

Shell.getHistoryIndex

getHistoryIndex()

Public method to get the current value of the history index.

Returns:
history index
Return Type:
int

Shell.handlePreferencesChanged

handlePreferencesChanged()

Public slot to handle the preferencesChanged signal.

Shell.historyStyle

historyStyle()

Public method to get the shell history style.

Returns:
shell history style
Return Type:
ShellHistoryStyle

Shell.insert

insert(txt)

Public slot to insert text at the current cursor position.

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

txt
text to be inserted (string)

Shell.isHistoryEnabled

isHistoryEnabled()

Public method to check, if the history is enabled.

Returns:
flag indicating if history is enabled
Return Type:
bool

Shell.keyPressEvent

keyPressEvent(ev)

Protected method to handle the user input a key at a time.

ev
key event (QKeyEvent)

Shell.loadHistory

loadHistory(clientType)

Public method to load the history for the given client type.

clientType
type of the debug client (string)

Shell.mousePressEvent

mousePressEvent(event)

Protected method to handle the mouse press event.

event
the mouse press event (QMouseEvent)

Shell.paste

paste()

Public slot to handle the paste action.

Shell.reloadHistory

reloadHistory()

Public method to reload the history of the currently selected client type.

Shell.saveHistory

saveHistory(clientType)

Public method to save the history for the given client type.

clientType
type of the debug client (string)

Shell.searchNext

searchNext(txt, caseSensitive, wholeWord, regexp)

Public method to search the next occurrence of the given text.

txt (str)
text to search for
caseSensitive (bool)
flag indicating to perform a case sensitive search
wholeWord (bool)
flag indicating to search for whole words only
regexp (bool)
flag indicating a regular expression search

Shell.searchPrev

searchPrev(txt, caseSensitive, wholeWord, regexp)

Public method to search the previous occurrence of the given text.

txt (str)
text to search for
caseSensitive (bool)
flag indicating to perform a case sensitive search
wholeWord (bool)
flag indicating to search for whole words only
regexp (bool)
flag indicating a regular expression search

Shell.selectHistory

selectHistory()

Public slot to select a history entry to execute.

Shell.setDebuggerUI

setDebuggerUI(ui)

Public method to set the debugger UI.

ui
reference to the debugger UI object (DebugUI)

Shell.showHistory

showHistory()

Public slot to show the shell history dialog.

Shell.wheelEvent

wheelEvent(evt)

Protected method to handle wheel events.

evt
reference to the wheel event (QWheelEvent)
Up


ShellAssembly

Class implementing the containing widget for the shell.

Derived from

QWidget

Class Attributes

None

Class Methods

None

Methods

ShellAssembly Constructor
shell Public method to get a reference to the shell widget.
showFind Public method to display the search widget.

Static Methods

None

ShellAssembly (Constructor)

ShellAssembly(dbs, vm, project, horizontal=True, parent=None)

Constructor

dbs (DebugServer)
reference to the debug server object
vm (ViewManager)
reference to the viewmanager object
project (Project)
reference to the project object
horizontal (bool)
flag indicating a horizontal layout
parent (QWidget)
parent widget

ShellAssembly.shell

shell()

Public method to get a reference to the shell widget.

Returns:
reference to the shell widget (Shell)

ShellAssembly.showFind

showFind(txt="")

Public method to display the search widget.

txt
text to be shown in the combo (string)
Up


ShellHistoryStyle

Class defining the shell history styles.

Derived from

Enum

Class Attributes

Disabled
LinuxStyle
WindowsStyle

Class Methods

None

Methods

None

Static Methods

None
Up



Home ⌂Doc Index ◂Up ▴