ConsoleView class. More...
Public Member Functions | |
__init__ (self) | |
changeLine (self, text) | |
Replace currently entered command line with given text. | |
getCurrentLine (self) | |
Get text in current command line. | |
onKeyPress (self, widget, event) | |
Key press callback used for correcting behavior for console-like interfaces. | |
onKeyPressExtend (self, event) | |
For some reason we can't extend onKeyPress directly (bug #500900). | |
showPrompt (self, prompt) | |
Prints prompt at start of line. | |
showReturned (self, text) | |
Show returned text from last command and print new prompt. | |
write (self, text, editable=False) | |
Write given text to buffer. | |
Public Attributes | |
color_pat | |
color pattern | |
line_start | |
line start | |
mark | |
scroll mark | |
no_input_splitter | |
no input splitter | |
onKeyPress | |
onKeyPress function | |
prompt | |
prompt function | |
text_buffer | |
text buffer | |
Static Public Attributes | |
dict | ANSI_COLORS |
color list | |
Protected Member Functions | |
_changeLine (self, text) | |
Replace currently entered command line with given text. | |
_showPrompt (self, prompt) | |
Prints prompt at start of line. | |
_showReturned (self, text) | |
Show returned text from last command and print new prompt. | |
_write (self, text, editable=False) | |
Write given text to buffer. | |
Protected Attributes | |
_changeLine | |
_changeLine function | |
_showPrompt | |
_showPrompt function | |
_showReturned | |
_showReturned function | |
_write | |
_write function | |
ConsoleView class.
Definition at line 348 of file ipython_view.py.
visualizer.ipython_view.ConsoleView.__init__ | ( | self | ) |
Initialize console view.
Reimplemented in visualizer.ipython_view.IPythonView.
Definition at line 416 of file ipython_view.py.
|
protected |
Replace currently entered command line with given text.
text | Text to use as replacement. |
Definition at line 510 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write, visualizer.ipython_view.ConsoleView._write(), delete, visualizer.ipython_view.ConsoleView.line_start, and visualizer.ipython_view.ConsoleView.text_buffer.
|
protected |
Prints prompt at start of line.
prompt | Prompt to print. |
Definition at line 491 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write, visualizer.ipython_view.ConsoleView._write(), visualizer.ipython_view.ConsoleView.line_start, and visualizer.ipython_view.ConsoleView.text_buffer.
|
protected |
Show returned text from last command and print new prompt.
text | Text to show. |
Definition at line 544 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write, visualizer.ipython_view.ConsoleView._write(), visualizer.ipython_view.ConsoleView.line_start, and visualizer.ipython_view.ConsoleView.text_buffer.
|
protected |
Write given text to buffer.
text | Text to append. |
editable | If true, added text is editable. |
Definition at line 452 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(), and visualizer.ipython_view.ConsoleView._showReturned().
visualizer.ipython_view.ConsoleView.changeLine | ( | self, | |
text ) |
Replace currently entered command line with given text.
text | Text to use as replacement. |
Definition at line 501 of file ipython_view.py.
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().
visualizer.ipython_view.ConsoleView.getCurrentLine | ( | self | ) |
Get text in current command line.
Definition at line 522 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().
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 570 of file ipython_view.py.
References delete, visualizer.ipython_view.ConsoleView.line_start, visualizer.ipython_view.ConsoleView.onKeyPressExtend(), visualizer.ipython_view.IPythonView.onKeyPressExtend(), visualizer.ipython_view.ConsoleView.prompt, visualizer.ipython_view.IPythonView.prompt, visualizer.ipython_view.IterableIPShell.prompt, and visualizer.ipython_view.ConsoleView.text_buffer.
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 636 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView.onKeyPress().
visualizer.ipython_view.ConsoleView.showPrompt | ( | self, | |
prompt ) |
Prints prompt at start of line.
prompt | Prompt to print. |
Definition at line 482 of file ipython_view.py.
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().
visualizer.ipython_view.ConsoleView.showReturned | ( | self, | |
text ) |
Show returned text from last command and print new prompt.
text | Text to show. |
Definition at line 535 of file ipython_view.py.
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 442 of file ipython_view.py.
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().
|
protected |
_changeLine function
Definition at line 508 of file ipython_view.py.
|
protected |
_showPrompt function
Definition at line 489 of file ipython_view.py.
|
protected |
_showReturned function
Definition at line 542 of file ipython_view.py.
|
protected |
_write function
Definition at line 450 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._changeLine(), visualizer.ipython_view.ConsoleView._showPrompt(), and visualizer.ipython_view.ConsoleView._showReturned().
|
static |
color list
Definition at line 390 of file ipython_view.py.
visualizer.ipython_view.ConsoleView.color_pat |
color pattern
Definition at line 436 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._write().
visualizer.ipython_view.ConsoleView.line_start |
line start
Definition at line 437 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 424 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._write().
visualizer.ipython_view.ConsoleView.no_input_splitter |
no input splitter
Definition at line 564 of file ipython_view.py.
visualizer.ipython_view.ConsoleView.onKeyPress |
onKeyPress function
Definition at line 440 of file ipython_view.py.
visualizer.ipython_view.ConsoleView.prompt |
prompt function
Definition at line 559 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView.onKeyPress(), and visualizer.ipython_view.IPythonView.onKeyPressExtend().
visualizer.ipython_view.ConsoleView.text_buffer |
text buffer
Definition at line 423 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().