def init_display_formatter(self): """ Switch to the Sage IPython commandline rich output backend EXAMPLES:: sage: from sage.repl.interpreter import SageTerminalInteractiveShell sage: SageTerminalInteractiveShell().init_display_formatter() # not tested """ from sage.repl.rich_output.backend_ipython import BackendIPythonCommandline backend = BackendIPythonCommandline() backend.get_display_manager().switch_backend(backend, shell=self)
def init_display_formatter(self): """ Switch to the Sage IPython commandline rich output backend EXAMPLES:: sage: from sage.repl.interpreter import get_test_shell sage: shell = get_test_shell(); shell <sage.repl.interpreter.SageTestShell object at 0x...> sage: shell.quit() sage: shell.init_display_formatter() sage: shell.quit() """ from sage.repl.rich_output.backend_ipython import BackendIPythonCommandline self._ipython_backend = backend = BackendIPythonCommandline() self._display_manager = backend.get_display_manager() self._doctest_backend = self._display_manager.switch_backend(backend, shell=self)
def set_backend(text=True, plot=True): if text or plot: backend = BackendEmacs(text=text, plot=plot) else: backend = BackendIPythonCommandline() backend.get_display_manager().switch_backend(backend, shell=ip)