ConsoleView class. More...
Public Member Functions | |
def | __init__ (self) |
def | changeLine (self, text) |
Replace currently entered command line with given text. More... | |
def | getCurrentLine (self) |
Get text in current command line. More... | |
def | onKeyPress (self, widget, event) |
Key press callback used for correcting behavior for console-like interfaces. More... | |
def | onKeyPressExtend (self, event) |
For some reason we can't extend onKeyPress directly (bug #500900). More... | |
def | showPrompt (self, prompt) |
Prints prompt at start of line. More... | |
def | showReturned (self, text) |
Show returned text from last command and print new prompt. More... | |
def | write (self, text, editable=False) |
Write given text to buffer. More... | |
Public Attributes | |
color_pat | |
color pattern More... | |
line_start | |
line start More... | |
mark | |
scroll mark More... | |
text_buffer | |
text buffer More... | |
Static Public Attributes | |
dictionary | ANSI_COLORS |
color list More... | |
Private Member Functions | |
def | _changeLine (self, text) |
Replace currently entered command line with given text. More... | |
def | _showPrompt (self, prompt) |
Prints prompt at start of line. More... | |
def | _showReturned (self, text) |
Show returned text from last command and print new prompt. More... | |
def | _write (self, text, editable=False) |
Write given text to buffer. More... | |
ConsoleView class.
Definition at line 333 of file ipython_view.py.
def visualizer.ipython_view.ConsoleView.__init__ | ( | self | ) |
Initialize console view.
Reimplemented in visualizer.ipython_view.IPythonView.
Definition at line 368 of file ipython_view.py.
|
private |
Replace currently entered command line with given text.
text | Text to use as replacement. |
Definition at line 459 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write(), delete, visualizer.ipython_view.ConsoleView.line_start, and visualizer.ipython_view.ConsoleView.text_buffer.
Referenced by visualizer.ipython_view.ConsoleView.changeLine().
|
private |
Prints prompt at start of line.
prompt | Prompt to print. |
Definition at line 439 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write(), visualizer.ipython_view.ConsoleView.line_start, and visualizer.ipython_view.ConsoleView.text_buffer.
Referenced by visualizer.ipython_view.ConsoleView._showReturned(), and visualizer.ipython_view.ConsoleView.showPrompt().
|
private |
Show returned text from last command and print new prompt.
text | Text to show. |
Definition at line 491 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._showPrompt(), visualizer.ipython_view.ConsoleView._write(), visualizer.ipython_view.IterableIPShell.IP, visualizer.ipython_view.ConsoleView.line_start, visualizer.ipython_view.IterableIPShell.prompt, visualizer.ipython_view.IPythonView.prompt, and visualizer.ipython_view.ConsoleView.text_buffer.
Referenced by visualizer.ipython_view.ConsoleView.showReturned().
|
private |
Write given text to buffer.
text | Text to append. |
editable | If true, added text is editable. |
Definition at line 401 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView.color_pat, visualizer.ipython_view.ConsoleView.mark, and visualizer.ipython_view.ConsoleView.text_buffer.
Referenced by visualizer.ipython_view.ConsoleView._changeLine(), visualizer.ipython_view.ConsoleView._showPrompt(), visualizer.ipython_view.ConsoleView._showReturned(), and visualizer.ipython_view.ConsoleView.write().
def visualizer.ipython_view.ConsoleView.changeLine | ( | self, | |
text | |||
) |
Replace currently entered command line with given text.
text | Text to use as replacement. |
Definition at line 450 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._changeLine().
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().
def visualizer.ipython_view.ConsoleView.getCurrentLine | ( | self | ) |
Get text in current command line.
Definition at line 471 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView.line_start, and visualizer.ipython_view.ConsoleView.text_buffer.
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend(), and visualizer.ipython_view.IPythonView.raw_input().
def visualizer.ipython_view.ConsoleView.onKeyPress | ( | self, | |
widget, | |||
event | |||
) |
Key press callback used for correcting behavior for console-like interfaces.
For example 'home' should go to prompt, not to beginning of line.
widget | Widget that key press accored in. |
event | Event object |
Definition at line 515 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView.line_start, visualizer.ipython_view.ConsoleView.onKeyPressExtend(), visualizer.ipython_view.IPythonView.onKeyPressExtend(), and visualizer.ipython_view.ConsoleView.text_buffer.
def visualizer.ipython_view.ConsoleView.onKeyPressExtend | ( | self, | |
event | |||
) |
For some reason we can't extend onKeyPress directly (bug #500900).
event | key press |
Reimplemented in visualizer.ipython_view.IPythonView.
Definition at line 558 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView.onKeyPress().
def visualizer.ipython_view.ConsoleView.showPrompt | ( | self, | |
prompt | |||
) |
Prints prompt at start of line.
prompt | Prompt to print. |
Definition at line 430 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._showPrompt().
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().
def visualizer.ipython_view.ConsoleView.showReturned | ( | self, | |
text | |||
) |
Show returned text from last command and print new prompt.
text | Text to show. |
Definition at line 482 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._showReturned().
def visualizer.ipython_view.ConsoleView.write | ( | self, | |
text, | |||
editable = False |
|||
) |
Write given text to buffer.
text | Text to append. |
editable | If true, added text is editable. |
Definition at line 391 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write().
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().
|
static |
color list
Definition at line 359 of file ipython_view.py.
visualizer.ipython_view.ConsoleView.color_pat |
color pattern
Definition at line 385 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._write().
visualizer.ipython_view.ConsoleView.line_start |
line start
Definition at line 386 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._changeLine(), visualizer.ipython_view.ConsoleView._showPrompt(), visualizer.ipython_view.ConsoleView._showReturned(), visualizer.ipython_view.ConsoleView.getCurrentLine(), and visualizer.ipython_view.ConsoleView.onKeyPress().
visualizer.ipython_view.ConsoleView.mark |
scroll mark
Definition at line 376 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._write().
visualizer.ipython_view.ConsoleView.text_buffer |
text buffer
Definition at line 375 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._changeLine(), visualizer.ipython_view.ConsoleView._showPrompt(), visualizer.ipython_view.ConsoleView._showReturned(), visualizer.ipython_view.ConsoleView._write(), visualizer.ipython_view.ConsoleView.getCurrentLine(), and visualizer.ipython_view.ConsoleView.onKeyPress().