# 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.
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.
eventFilter | Protected method to handle some event on behalve of our componentes.
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.
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.
handleClientStatement | Private method to handle the response from the debugger client.
handlePreferencesChanged | Public slot to handle the preferencesChanged signal.
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.
paste | Reimplemented slot to handle the paste action.
raw_input | Private method to handle raw input.
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
parent
  parent widget (QWidget)
vm
  reference to the viewmanager object

### 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.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.eventFilter

eventFilter(obj, evt)

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

evt
  the event to be handled (QEvent)
obj
  destination object of the event (QObject)

Returns:
  flag to indicate, if the event was handled

### 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.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.handleClientStatement

handleClientStatement(more)

Private method to handle the response from the debugger client.

more
  flag indicating that more user input is required

### Shell.handlePreferencesChanged

handlePreferencesChanged()

Public slot to handle the preferencesChanged signal.

### 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.paste

paste()

Reimplemented slot to handle the paste action.

### Shell.raw_input

raw_input(s, echo)

Private method to handle raw input.

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

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

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

Up