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

IPythonView class. More...

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

Public Member Functions

def __init__ (self)
 
def onKeyPressExtend (self, event)
 Key press callback with plenty of shell goodness, like history, autocompletions, etc.
 
def raw_input (self, prompt="")
 Custom raw_input() replacement.
 
- Public Member Functions inherited from visualizer.ipython_view.ConsoleView
def __init__ (self)
 
def changeLine (self, text)
 Replace currently entered command line with given text.
 
def getCurrentLine (self)
 Get text in current command line.
 
def onKeyPress (self, widget, event)
 Key press callback used for correcting behavior for console-like interfaces.
 
def onKeyPressExtend (self, event)
 For some reason we can't extend onKeyPress directly (bug #500900).
 
def showPrompt (self, prompt)
 Prints prompt at start of line.
 
def showReturned (self, text)
 Show returned text from last command and print new prompt.
 
def write (self, text, editable=False)
 Write given text to buffer.
 
- Public Member Functions inherited from visualizer.ipython_view.IterableIPShell
def __init__ (self, argv=[], user_ns=None, user_global_ns=None, cin=None, cout=None, cerr=None, input_func=None)
 Constructor for the IterableIPShell class.
 
def complete (self, line)
 Returns an auto completed line and/or possibilities for completion.
 
def execute (self)
 Executes the current line provided by the shell object.
 
def generatePrompt (self, is_continuation)
 Generate prompt depending on is_continuation value.
 
def historyBack (self)
 Provides one history command back.
 
def historyForward (self)
 Provides one history command forward.
 
def shell (self, cmd, verbose=0, debug=0, header="")
 Replacement method to allow shell commands without them blocking.
 
def updateNamespace (self, ns_dict)
 Add the current dictionary to the shell namespace.
 

Public Attributes

 cout
 cout
 
 history_pos
 history list
 
 interrupt
 interrupt
 
 prompt
 prompt
 
- Public Attributes inherited from visualizer.ipython_view.ConsoleView
 color_pat
 color pattern
 
 line_start
 line start
 
 mark
 scroll mark
 
 text_buffer
 text buffer
 
- Public Attributes inherited from visualizer.ipython_view.IterableIPShell
 complete_sep
 separators
 
 history_level
 history level
 
 indent_spaces
 indent spaces
 
 IP
 IP.
 
 iter_more
 iterate more
 
 lines
 lines
 
 no_input_splitter
 no input splitter
 
 prompt
 prompt
 

Protected Member Functions

def _processLine (self)
 Process current command line.
 
- Protected Member Functions inherited from visualizer.ipython_view.ConsoleView
def _changeLine (self, text)
 Replace currently entered command line with given text.
 
def _showPrompt (self, prompt)
 Prints prompt at start of line.
 
def _showReturned (self, text)
 Show returned text from last command and print new prompt.
 
def _write (self, text, editable=False)
 Write given text to buffer.
 
- Protected Member Functions inherited from visualizer.ipython_view.IterableIPShell
def _getHistory (self)
 Gets the command string of the current history level.
 

Additional Inherited Members

- Static Public Attributes inherited from visualizer.ipython_view.ConsoleView
dict ANSI_COLORS
 color list
 

Detailed Description

IPythonView class.

Definition at line 644 of file ipython_view.py.

Constructor & Destructor Documentation

◆ __init__()

def visualizer.ipython_view.IPythonView.__init__ (   self)
Initialize. Redirect I/O to console.

Reimplemented from visualizer.ipython_view.IterableIPShell.

Definition at line 664 of file ipython_view.py.

Member Function Documentation

◆ _processLine()

def visualizer.ipython_view.IPythonView._processLine (   self)
protected

Process current command line.

Returns
none

Definition at line 724 of file ipython_view.py.

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

+ Here is the caller graph for this function:

◆ onKeyPressExtend()

def visualizer.ipython_view.IPythonView.onKeyPressExtend (   self,
  event 
)

Key press callback with plenty of shell goodness, like history, autocompletions, etc.

Parameters
eventEvent object.
Returns
True if event should not trickle.

Reimplemented from visualizer.ipython_view.ConsoleView.

Definition at line 689 of file ipython_view.py.

References visualizer.ipython_view.IPythonView._processLine(), visualizer.ipython_view.ConsoleView.changeLine(), visualizer.ipython_view.IterableIPShell.complete(), visualizer.ipython_view.ConsoleView.getCurrentLine(), visualizer.ipython_view.IterableIPShell.historyBack(), visualizer.ipython_view.IterableIPShell.historyForward(), visualizer.ipython_view.IPythonView.interrupt, visualizer.ipython_view.IterableIPShell.prompt, visualizer.ipython_view.IPythonView.prompt, visualizer.ipython_view.ConsoleView.showPrompt(), and visualizer.ipython_view.ConsoleView.write().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ raw_input()

def visualizer.ipython_view.IPythonView.raw_input (   self,
  prompt = "" 
)

Custom raw_input() replacement.

Gets current line from console buffer.

Parameters
promptPrompt to print. Here for compatibility as replacement.
Returns
The current command line text.

Definition at line 677 of file ipython_view.py.

References visualizer.ipython_view.ConsoleView.getCurrentLine(), visualizer.ipython_view.IPythonView.interrupt, and visualizer.ipython_view.IPythonView.raw_input().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ cout

visualizer.ipython_view.IPythonView.cout

cout

Definition at line 669 of file ipython_view.py.

◆ history_pos

visualizer.ipython_view.IPythonView.history_pos

history list

Definition at line 729 of file ipython_view.py.

◆ interrupt

visualizer.ipython_view.IPythonView.interrupt

◆ prompt


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