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

IterableIPShell class. More...

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

Public Member Functions

 __init__ (self, argv=[], user_ns=None, user_global_ns=None, cin=None, cout=None, cerr=None, input_func=None)
 Constructor for the IterableIPShell class.
 
 complete (self, line)
 Returns an auto completed line and/or possibilities for completion.
 
 execute (self)
 Executes the current line provided by the shell object.
 
 generatePrompt (self, is_continuation)
 Generate prompt depending on is_continuation value.
 
 historyBack (self)
 Provides one history command back.
 
 historyForward (self)
 Provides one history command forward.
 
 shell (self, cmd, verbose=0, debug=0, header="")
 Replacement method to allow shell commands without them blocking.
 
 updateNamespace (self, ns_dict)
 Add the current dictionary to the shell namespace.
 

Public Attributes

 complete_sep = re.compile(r"[\s\{\}\[\]\‍(\‍)]")
 separators
 
int history_level = 0
 history level
 
str indent_spaces = ""
 indent spaces
 
 IP = IPython.terminal.embed.InteractiveShellEmbed.instance(config=cfg, user_ns=user_ns)
 IP.
 
int iter_more = 0
 iterate more
 
list lines = []
 lines
 
 no_input_splitter = Version("5.8.0")
 no input splitter
 
 prompt = self.generatePrompt(self.iter_more)
 prompt
 

Protected Member Functions

 _getHistory (self)
 Gets the command string of the current history level.
 

Private Member Functions

 __update_namespace (self)
 Update self.IP namespace for autocompletion with sys.modules.
 

Detailed Description

IterableIPShell class.

Definition at line 40 of file ipython_view.py.

Constructor & Destructor Documentation

◆ __init__()

visualizer.ipython_view.IterableIPShell.__init__ ( self,
argv = [],
user_ns = None,
user_global_ns = None,
cin = None,
cout = None,
cerr = None,
input_func = None )

Constructor for the IterableIPShell class.

Parameters
selfthis object
argvCommand line options for IPython
user_nsUser namespace.
user_global_nsUser global namespace.
cinConsole standard input.
coutConsole standard output.
cerrConsole standard error.
input_funcReplacement for builtin raw_input()

Definition at line 66 of file ipython_view.py.

Member Function Documentation

◆ __update_namespace()

visualizer.ipython_view.IterableIPShell.__update_namespace ( self)
private

Update self.IP namespace for autocompletion with sys.modules.

Returns
none

Definition at line 156 of file ipython_view.py.

References IP.

◆ _getHistory()

visualizer.ipython_view.IterableIPShell._getHistory ( self)
protected

Gets the command string of the current history level.

Parameters
selfthis object
Returns
: Historic command string.

Definition at line 268 of file ipython_view.py.

References history_level, and IP.

Referenced by historyBack(), and historyForward().

+ Here is the caller graph for this function:

◆ complete()

visualizer.ipython_view.IterableIPShell.complete ( self,
line )

Returns an auto completed line and/or possibilities for completion.

Parameters
lineGiven line so far.
Returns
: Line completed as for as possible, and possible further completions.

Definition at line 290 of file ipython_view.py.

References complete(), complete_sep, and IP.

Referenced by complete(), and visualizer.ipython_view.IPythonView.onKeyPressExtend().

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

◆ execute()

visualizer.ipython_view.IterableIPShell.execute ( self)

Executes the current line provided by the shell object.

Returns
none

Definition at line 165 of file ipython_view.py.

References history_level.

◆ generatePrompt()

visualizer.ipython_view.IterableIPShell.generatePrompt ( self,
is_continuation )

Generate prompt depending on is_continuation value.

Parameters
is_continuation
Returns
: The prompt string representation

Definition at line 230 of file ipython_view.py.

◆ historyBack()

visualizer.ipython_view.IterableIPShell.historyBack ( self)

Provides one history command back.

Parameters
selfthis object
Returns
: The command string.

Definition at line 245 of file ipython_view.py.

References _getHistory(), and history_level.

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

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

◆ historyForward()

visualizer.ipython_view.IterableIPShell.historyForward ( self)

Provides one history command forward.

Parameters
selfthis object
Returns
: The command string.

Definition at line 257 of file ipython_view.py.

References _getHistory(), and history_level.

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

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

◆ shell()

visualizer.ipython_view.IterableIPShell.shell ( self,
cmd,
verbose = 0,
debug = 0,
header = "" )

Replacement method to allow shell commands without them blocking.

Parameters
cmdShell command to execute.
verboseVerbosity
debugDebug level
headerHeader to be printed before output
Returns
none

Definition at line 327 of file ipython_view.py.

◆ updateNamespace()

visualizer.ipython_view.IterableIPShell.updateNamespace ( self,
ns_dict )

Add the current dictionary to the shell namespace.

Parameters
ns_dictA dictionary of symbol-values.
Returns
none

Definition at line 281 of file ipython_view.py.

References IP.

Member Data Documentation

◆ complete_sep

visualizer.ipython_view.IterableIPShell.complete_sep = re.compile(r"[\s\{\}\[\]\‍(\‍)]")

separators

Definition at line 142 of file ipython_view.py.

Referenced by complete().

◆ history_level

int visualizer.ipython_view.IterableIPShell.history_level = 0

history level

Definition at line 141 of file ipython_view.py.

Referenced by _getHistory(), execute(), historyBack(), and historyForward().

◆ indent_spaces

visualizer.ipython_view.IterableIPShell.indent_spaces = ""

indent spaces

Definition at line 154 of file ipython_view.py.

◆ IP

visualizer.ipython_view.IterableIPShell.IP = IPython.terminal.embed.InteractiveShellEmbed.instance(config=cfg, user_ns=user_ns)

IP.

Definition at line 126 of file ipython_view.py.

Referenced by __update_namespace(), _getHistory(), complete(), and updateNamespace().

◆ iter_more

int visualizer.ipython_view.IterableIPShell.iter_more = 0

iterate more

Definition at line 140 of file ipython_view.py.

◆ lines

list visualizer.ipython_view.IterableIPShell.lines = []

lines

Definition at line 153 of file ipython_view.py.

◆ no_input_splitter

visualizer.ipython_view.IterableIPShell.no_input_splitter = Version("5.8.0")

no input splitter

Definition at line 152 of file ipython_view.py.

◆ prompt

visualizer.ipython_view.IterableIPShell.prompt = self.generatePrompt(self.iter_more)

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