Module ipython_view :: Class IterableIPShell
[hide private]
[frames] | no frames]

Class IterableIPShell

source code


Create an IPython instance. Does not start a blocking event loop, instead allow single iterations. This allows embedding in GTK+ without blockage

@ivar IP: IPython instance. @type IP: IPython.iplib.InteractiveShell @ivar iter_more: Indicates if the line executed was a complete command, or we should wait for more. @type iter_more: integer @ivar history_level: The place in history where we currently are when pressing up/down. @type history_level: integer @ivar complete_sep: Seperation delimeters for completion function. @type complete_sep: _sre.SRE_Pattern

Instance Methods [hide private]
 
__init__(self, argv=[], user_ns=None, user_global_ns=None, cin=None, cout=None, cerr=None, input_func=None)
@param argv: Command line options for IPython @type argv: list @param user_ns: User namespace.
source code
 
execute(self)
Execute the current line provided by the shell object
source code
 
historyBack(self)
Provide one history command back
source code
 
historyForward(self)
Provide one history command forward
source code
 
_getHistory(self)
Get the command string of the current history level
source code
 
updateNamespace(self, ns_dict)
Add the current dictionary to the shell namespace
source code
 
complete(self, line)
Returns an auto completed line and/or posibilities for completion
source code
 
shell(self, cmd, verbose=0, debug=0, header='')
Replacement method to allow shell commands without them blocking
source code
Method Details [hide private]

__init__(self, argv=[], user_ns=None, user_global_ns=None, cin=None, cout=None, cerr=None, input_func=None)
(Constructor)

source code 
@param argv: Command line options for IPython @type argv: list @param user_ns: User namespace. @type user_ns: dictionary @param user_global_ns: User global namespace. @type user_global_ns: dictionary. @param cin: Console standard input. @type cin: IO stream @param cout: Console standard output. @type cout: IO stream @param cerr: Console standard error. @type cerr: IO stream @param input_func: Replacement for builtin raw_input() @type input_func: function

execute(self)

source code 
Execute the current line provided by the shell object

historyBack(self)

source code 

Provide one history command back

@return: The command string. @rtype: string

historyForward(self)

source code 

Provide one history command forward

@return: The command string. @rtype: string

_getHistory(self)

source code 

Get the command string of the current history level

@return: Historic command string. @rtype: string

updateNamespace(self, ns_dict)

source code 

Add the current dictionary to the shell namespace

@param ns_dict: A dictionary of symbol-values. @type ns_dict: dictionary

complete(self, line)

source code 

Returns an auto completed line and/or posibilities for completion

@param line: Given line so far. @type line: string

@return: Line completed as for as possible, and possible further completions. @rtype: tuple

shell(self, cmd, verbose=0, debug=0, header='')

source code 

Replacement method to allow shell commands without them blocking

@param cmd: Shell command to execute. @type cmd: string @param verbose: Verbosity @type verbose: integer @param debug: Debug level @type debug: integer @param header: Header to be printed before output @type header: string