# eric7.MicroPython.MicroPythonReplWidget

Module implementing the MicroPython REPL widget.

### Global Attributes

AnsiColorSchemes

### Classes

MicroPythonReplEdit | Class implementing the REPL edit pane.
MicroPythonReplWidget | Class implementing the MicroPython REPL widget.

### Functions

None

## MicroPythonReplEdit

Class implementing the REPL edit pane.

### Signals

osdInfo(str)
  emitted when some OSD data was received from the device

### Derived from

QTextEdit

### Class Attributes

None

### Class Methods

None

### Methods

MicroPythonReplEdit | Constructor
__clear | Private slot to clear the REPL pane.
__paste | Private slot to perform a paste operation.
__setCharFormat | Private method setting the current text format of the REPL pane based on the passed ANSI codes.
__showContextMenu | Private slot to show the REPL context menu.
doZoom | Public slot to zoom in or out.
handlePreferencesChanged | Public slot to handle a change in preferences.
keyPressEvent | Protected method to handle key press events.
mouseReleaseEvent | Protected method to handle mouse release events.
processData | Public slot to process the data received from the device.
setInterface | Public method to set the reference to the device interface object.

### Static Methods

None

#### MicroPythonReplEdit (Constructor)

MicroPythonReplEdit(parent=None)

Constructor

parent (QWidget (optional))
  reference to the parent widget (defaults to None)

#### MicroPythonReplEdit.__clear

__clear()

Private slot to clear the REPL pane.

#### MicroPythonReplEdit.__paste

__paste(mode=QClipboard.Mode.Clipboard)

Private slot to perform a paste operation.

mode (QClipboard.Mode (optional))
  paste mode (defaults to QClipboard.Mode.Clipboard)

#### MicroPythonReplEdit.__setCharFormat

__setCharFormat(formatCodes, textCursor)

Private method setting the current text format of the REPL pane based on the passed ANSI codes.

Following codes are used:

- 0: Reset
- 1: Bold font (weight 75)
- 2: Light font (weight 25)
- 3: Italic font
- 4: Underlined font
- 9: Strikeout font
- 21: Bold off (weight 50)
- 22: Light off (weight 50)
- 23: Italic off
- 24: Underline off
- 29: Strikeout off
- 30: foreground Black
- 31: foreground Dark Red
- 32: foreground Dark Green
- 33: foreground Dark Yellow
- 34: foreground Dark Blue
- 35: foreground Dark Magenta
- 36: foreground Dark Cyan
- 37: foreground Light Gray
- 39: reset foreground to default
- 40: background Black
- 41: background Dark Red
- 42: background Dark Green
- 43: background Dark Yellow
- 44: background Dark Blue
- 45: background Dark Magenta
- 46: background Dark Cyan
- 47: background Light Gray
- 49: reset background to default
- 53: Overlined font
- 55: Overline off
- 90: bright foreground Dark Gray
- 91: bright foreground Red
- 92: bright foreground Green
- 93: bright foreground Yellow
- 94: bright foreground Blue
- 95: bright foreground Magenta
- 96: bright foreground Cyan
- 97: bright foreground White
- 100: bright background Dark Gray
- 101: bright background Red
- 102: bright background Green
- 103: bright background Yellow
- 104: bright background Blue
- 105: bright background Magenta
- 106: bright background Cyan
- 107: bright background White

formatCodes (list of str)
  list of format codes
textCursor (QTextCursor)
  reference to the text cursor

#### MicroPythonReplEdit.__showContextMenu

__showContextMenu(pos)

Private slot to show the REPL context menu.

pos (QPoint)
  position to show the menu at

#### MicroPythonReplEdit.doZoom

doZoom(value)

Public slot to zoom in or out.

value (int)
  zoom value

#### MicroPythonReplEdit.handlePreferencesChanged

handlePreferencesChanged()

Public slot to handle a change in preferences.

#### MicroPythonReplEdit.keyPressEvent

keyPressEvent(evt)

Protected method to handle key press events.

evt (QKeyEvent)
  reference to the key press event

#### MicroPythonReplEdit.mouseReleaseEvent

mouseReleaseEvent(evt)

Protected method to handle mouse release events.

evt (QMouseEvent)
  reference to the event object

#### MicroPythonReplEdit.processData

processData(data)

Public slot to process the data received from the device.

data (bytes)
  data received from the device

#### MicroPythonReplEdit.setInterface

setInterface(deviceInterface)

Public method to set the reference to the device interface object.

deviceInterface (MicroPythonDeviceInterface)
  reference to the device interface object

Up

## MicroPythonReplWidget

Class implementing the MicroPython REPL widget.

### Derived from

QWidget

### Class Attributes

ZoomMax
ZoomMin

### Class Methods

None

### Methods

MicroPythonReplWidget | Constructor
clearOSD | Public slot to clear the OSD info.
replEdit | Public method to get a reference to the REPL edit.
setOSDInfo | Public slot to set the OSD information.

### Static Methods

None

#### MicroPythonReplWidget (Constructor)

MicroPythonReplWidget(parent=None)

Constructor

parent (QWidget (optional))
  reference to the parent widget (defaults to None)

#### MicroPythonReplWidget.clearOSD

clearOSD()

Public slot to clear the OSD info.

#### MicroPythonReplWidget.replEdit

replEdit()

Public method to get a reference to the REPL edit.

Return:
  reference to the REPL edit

Return Type:
  MicroPythonReplEdit

#### MicroPythonReplWidget.setOSDInfo

setOSDInfo(infoStr)

Public slot to set the OSD information.

infoStr (str)
  string to be shown

Up