Public Member Functions | |
def | __init__ |
def | changeLine |
def | getCurrentLine |
def | onKeyPress |
def | onKeyPressExtend |
def | showPrompt |
def | showReturned |
def | write |
Public Attributes | |
color_pat | |
line_start | |
mark | |
text_buffer | |
Static Public Attributes | |
dictionary | ANSI_COLORS |
Private Member Functions | |
def | _changeLine |
def | _showPrompt |
def | _showReturned |
def | _write |
Specialized text view for console-like workflow. @cvar ANSI_COLORS: Mapping of terminal colors to X11 names. @type ANSI_COLORS: dictionary @ivar text_buffer: Widget's text buffer. @type text_buffer: gtk.TextBuffer @ivar color_pat: Regex of terminal color pattern @type color_pat: _sre.SRE_Pattern @ivar mark: Scroll mark for automatic scrolling on input. @type mark: gtk.TextMark @ivar line_start: Start of command line mark. @type line_start: gtk.TextMark
Definition at line 308 of file ipython_view.py.
def visualizer.ipython_view.ConsoleView.__init__ | ( | self | ) |
Initialize console view.
Definition at line 333 of file ipython_view.py.
|
private |
Replace currently entered command line with given text. @param text: Text to use as replacement. @type text: string
Definition at line 406 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write(), and visualizer.ipython_view.ConsoleView.line_start.
Referenced by visualizer.ipython_view.ConsoleView.changeLine().
|
private |
Prints prompt at start of line. @param prompt: Prompt to print. @type prompt: string
Definition at line 392 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write(), and visualizer.ipython_view.ConsoleView.line_start.
Referenced by visualizer.ipython_view.ConsoleView._showReturned(), and visualizer.ipython_view.ConsoleView.showPrompt().
|
private |
Show returned text from last command and print new prompt. @param text: Text to show. @type text: string
Definition at line 433 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._showPrompt(), visualizer.ipython_view.ConsoleView._write(), visualizer.ipython_view.ConsoleView.line_start, visualizer.ipython_view.IterableIPShell.prompt, and visualizer.ipython_view.IPythonView.prompt.
Referenced by visualizer.ipython_view.ConsoleView.showReturned().
|
private |
Write given text to buffer. @param text: Text to append. @type text: string @param editable: If true, added text is editable. @type editable: boolean
Definition at line 359 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView.mark.
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 | |||
) |
Definition at line 403 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. @return: Text of current command line. @rtype: string
Definition at line 418 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView.line_start.
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 begining of line. @param widget: Widget that key press accored in. @type widget: gtk.Widget @param event: Event object @type event: gtk.gdk.Event @return: Return True if event should not trickle. @rtype: boolean
Definition at line 457 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView.line_start, and visualizer.ipython_view.ConsoleView.onKeyPressExtend().
def visualizer.ipython_view.ConsoleView.onKeyPressExtend | ( | self, | |
event | |||
) |
For some reason we can't extend onKeyPress directly (bug #500900).
Definition at line 504 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView.onKeyPress().
def visualizer.ipython_view.ConsoleView.showPrompt | ( | self, | |
prompt | |||
) |
Definition at line 389 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 | |||
) |
Definition at line 430 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._showReturned().
def visualizer.ipython_view.ConsoleView.write | ( | self, | |
text, | |||
editable = False |
|||
) |
Definition at line 356 of file ipython_view.py.
References visualizer.ipython_view.ConsoleView._write().
Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().
|
static |
Definition at line 324 of file ipython_view.py.
visualizer.ipython_view.ConsoleView.color_pat |
Definition at line 350 of file ipython_view.py.
visualizer.ipython_view.ConsoleView.line_start |
Definition at line 351 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 |
Definition at line 341 of file ipython_view.py.
Referenced by visualizer.ipython_view.ConsoleView._write().
visualizer.ipython_view.ConsoleView.text_buffer |
Definition at line 340 of file ipython_view.py.