A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
visualizer.ipython_view.ConsoleView Class Reference

ConsoleView class. More...

+ Inheritance diagram for visualizer.ipython_view.ConsoleView:
+ Collaboration diagram for visualizer.ipython_view.ConsoleView:

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
 

Detailed Description

ConsoleView class.

Definition at line 348 of file ipython_view.py.

Constructor & Destructor Documentation

◆ __init__()

visualizer.ipython_view.ConsoleView.__init__ ( self)
Initialize console view.

Reimplemented in visualizer.ipython_view.IPythonView.

Definition at line 416 of file ipython_view.py.

Member Function Documentation

◆ _changeLine()

visualizer.ipython_view.ConsoleView._changeLine ( self,
text )
protected

Replace currently entered command line with given text.

Parameters
textText to use as replacement.
Returns
none

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.

+ Here is the call graph for this function:

◆ _showPrompt()

visualizer.ipython_view.ConsoleView._showPrompt ( self,
prompt )
protected

Prints prompt at start of line.

Parameters
promptPrompt to print.
Returns
none

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.

+ Here is the call graph for this function:

◆ _showReturned()

visualizer.ipython_view.ConsoleView._showReturned ( self,
text )
protected

Show returned text from last command and print new prompt.

Parameters
textText to show.
Returns
none

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.

+ Here is the call graph for this function:

◆ _write()

visualizer.ipython_view.ConsoleView._write ( self,
text,
editable = False )
protected

Write given text to buffer.

Parameters
textText to append.
editableIf true, added text is editable.
Returns
none

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().

+ Here is the caller graph for this function:

◆ changeLine()

visualizer.ipython_view.ConsoleView.changeLine ( self,
text )

Replace currently entered command line with given text.

Parameters
textText to use as replacement.
Returns
none

Definition at line 501 of file ipython_view.py.

Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().

+ Here is the caller graph for this function:

◆ getCurrentLine()

visualizer.ipython_view.ConsoleView.getCurrentLine ( self)

Get text in current command line.

Returns
Text of 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().

+ Here is the caller graph for this function:

◆ onKeyPress()

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.

Parameters
widgetWidget that key press accored in.
eventEvent object
Returns
Return True if event should not trickle.

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.

+ Here is the call graph for this function:

◆ onKeyPressExtend()

visualizer.ipython_view.ConsoleView.onKeyPressExtend ( self,
event )

For some reason we can't extend onKeyPress directly (bug #500900).

Parameters
eventkey press
Returns
none

Reimplemented in visualizer.ipython_view.IPythonView.

Definition at line 636 of file ipython_view.py.

Referenced by visualizer.ipython_view.ConsoleView.onKeyPress().

+ Here is the caller graph for this function:

◆ showPrompt()

visualizer.ipython_view.ConsoleView.showPrompt ( self,
prompt )

Prints prompt at start of line.

Parameters
promptPrompt to print.
Returns
none

Definition at line 482 of file ipython_view.py.

Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().

+ Here is the caller graph for this function:

◆ showReturned()

visualizer.ipython_view.ConsoleView.showReturned ( self,
text )

Show returned text from last command and print new prompt.

Parameters
textText to show.
Returns
none

Definition at line 535 of file ipython_view.py.

◆ write()

visualizer.ipython_view.ConsoleView.write ( self,
text,
editable = False )

Write given text to buffer.

Parameters
textText to append.
editableIf true, added text is editable.
Returns
none

Definition at line 442 of file ipython_view.py.

Referenced by visualizer.ipython_view.IPythonView.onKeyPressExtend().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _changeLine

visualizer.ipython_view.ConsoleView._changeLine
protected

_changeLine function

Definition at line 508 of file ipython_view.py.

◆ _showPrompt

visualizer.ipython_view.ConsoleView._showPrompt
protected

_showPrompt function

Definition at line 489 of file ipython_view.py.

◆ _showReturned

visualizer.ipython_view.ConsoleView._showReturned
protected

_showReturned function

Definition at line 542 of file ipython_view.py.

◆ _write

visualizer.ipython_view.ConsoleView._write
protected

◆ ANSI_COLORS

dict visualizer.ipython_view.ConsoleView.ANSI_COLORS
static
Initial value:
= {
"0;30": ("Black", None),
"0;31": ("Red", None),
"0;32": ("Green", None),
"0;33": ("Brown", None),
"0;34": ("Blue", None),
"0;35": ("Purple", None),
"0;36": ("Cyan", None),
"0;37": ("LightGray", None),
"1;30": ("DarkGray", None),
"1;31": ("DarkRed", None),
"1;32": ("SeaGreen", None),
"1;33": ("Yellow", None),
"1;34": ("LightBlue", None),
"1;35": ("MediumPurple", None),
"1;36": ("LightCyan", None),
"1;37": ("White", None),
"38;5;124;43": ("DarkRed", "Yellow"),
"38;5;241": ("Gray", None),
"38;5;241;43": ("Gray", "Yellow"),
"39": ("Black", None),
"39;49": ("Red", "White"),
"43": (None, "Yellow"),
"49": (None, "White"),
}

color list

Definition at line 390 of file ipython_view.py.

◆ color_pat

visualizer.ipython_view.ConsoleView.color_pat

color pattern

Definition at line 436 of file ipython_view.py.

Referenced by visualizer.ipython_view.ConsoleView._write().

◆ line_start

◆ mark

visualizer.ipython_view.ConsoleView.mark

scroll mark

Definition at line 424 of file ipython_view.py.

Referenced by visualizer.ipython_view.ConsoleView._write().

◆ no_input_splitter

visualizer.ipython_view.ConsoleView.no_input_splitter

no input splitter

Definition at line 564 of file ipython_view.py.

◆ onKeyPress

visualizer.ipython_view.ConsoleView.onKeyPress

onKeyPress function

Definition at line 440 of file ipython_view.py.

◆ prompt

visualizer.ipython_view.ConsoleView.prompt

◆ text_buffer


The documentation for this class was generated from the following file: