Module: frontend.linefrontendbase

Inheritance diagram for IPython.frontend.linefrontendbase:

Base front end class for all line-oriented frontends, rather than block-oriented.

Currently this focuses on synchronous frontends.


class IPython.frontend.linefrontendbase.LineFrontEndBase(shell=None, history=None, banner=None, *args, **kwargs)

Bases: IPython.frontend.frontendbase.FrontEndBase

Concrete implementation of the FrontEndBase class. This is meant to be the base class behind all the frontend that are line-oriented, rather than block-oriented.

__init__(shell=None, history=None, banner=None, *args, **kwargs)
All the operations required after an execution to put the terminal back in a shape where it is usable.

Complete line in engine’s user_ns

Parameters:line : string
Returns:The replacement for the line and the list of possible completions. :
Do code completion on current line.
Returns the current continuation prompt.
execute(python_string, raw_string=None)
Stores the raw_string in the history, and sends the python string to the interpreter.
execute_command(command, hidden=False)
Execute a command, not only in the model, but also in the view, if any.
Return the width of the line in characters.

Check if a string forms a complete, executable set of commands.

For the line-oriented frontend, multi-line code is not executed as soon as it is complete: the users has to enter two line returns.


Prints a prompt and starts a new editing buffer.

Subclasses should use this method to make sure that the terminal is put in a state favorable for a new line input.

Prefilter the input to turn it in valid python.
Frontend-specific rendering of error.
Frontend-specific rendering of the result of a calculation that has been sent to an engine.
Put the frontend in a state where it is ready for user interaction.
write(string, refresh=True)

Write some characters to the display.

Subclass should overide this method.

The refresh keyword argument is used in frontends with an event loop, to choose whether the write should trigget an UI refresh, and thus be syncrhonous, or not.

write_completion(possibilities, new_line=None)

Write the list of possible completions.

new_line is the completed input line that should be displayed after the completion are writen. If None, the input_buffer before the completion is used.

Given a list of strings, return the common prefix between all these strings.