TenjintShell

class tenjint.plugins.interactive.TenjintShell(**kwargs)[source]

Attributes

TenjintShell.active_eventloop

TenjintShell.alias_manager

A trait whose value must be an instance of a specified class.

TenjintShell.all_ns_refs

Get a list of references to all the namespace dictionaries in which IPython might store a user-created object.

TenjintShell.ast_node_interactivity

An enum whose value must be in a given sequence.

TenjintShell.ast_transformers

An instance of a Python list.

TenjintShell.autocall

An enum whose value must be in a given sequence.

TenjintShell.autoindent

A boolean (True, False) trait.

TenjintShell.automagic

A boolean (True, False) trait.

TenjintShell.banner

TenjintShell.banner1

A trait for unicode strings.

TenjintShell.banner2

A trait for unicode strings.

TenjintShell.builtin_trap

A trait whose value must be an instance of a specified class.

TenjintShell.cache_size

An int trait.

TenjintShell.call_pdb

Control auto-activation of pdb at exceptions

TenjintShell.color_info

A boolean (True, False) trait.

TenjintShell.colors

An enum of strings where the case should be ignored.

TenjintShell.config

A trait whose value must be an instance of a specified class.

TenjintShell.confirm_exit

A boolean (True, False) trait.

TenjintShell.cross_validation_lock

A contextmanager for running a block with our cross validation lock set to True.

TenjintShell.data_pub_class

TenjintShell.debug

A boolean (True, False) trait.

TenjintShell.debugger_cls

Modified Pdb class, does not load readline.

TenjintShell.debugger_history

TenjintShell.default_user_namespaces

TenjintShell.disable_failing_post_execute

A boolean (True, False) trait.

TenjintShell.display_banner

A casting version of the boolean trait.

TenjintShell.display_completions

An enum whose value must be in a given sequence.

TenjintShell.display_formatter

A trait whose value must be an instance of a specified class.

TenjintShell.display_page

A boolean (True, False) trait.

TenjintShell.display_pub_class

A trait whose value must be a subclass of a specified class.

TenjintShell.display_trap

A trait whose value must be an instance of a specified class.

TenjintShell.displayhook_class

A trait whose value must be a subclass of a specified class.

TenjintShell.dummy_mode

A boolean (True, False) trait.

TenjintShell.editing_mode

A trait for unicode strings.

TenjintShell.editor

A trait for unicode strings.

TenjintShell.embedded

A casting version of the boolean trait.

TenjintShell.embedded_active

TenjintShell.enable_history_search

A boolean (True, False) trait.

TenjintShell.enable_html_pager

A boolean (True, False) trait.

TenjintShell.execution_count

An int trait.

TenjintShell.exit_msg

A trait for unicode strings.

TenjintShell.exit_now

A boolean (True, False) trait.

TenjintShell.exiter

A trait whose value must be an instance of a specified class.

TenjintShell.extension_manager

A trait whose value must be an instance of a specified class.

TenjintShell.extra_open_editor_shortcuts

A boolean (True, False) trait.

TenjintShell.filename

A trait for unicode strings.

TenjintShell.handle_return

A trait which allows any value.

TenjintShell.highlight_matching_brackets

A boolean (True, False) trait.

TenjintShell.highlighting_style

A trait type representing a Union type.

TenjintShell.highlighting_style_overrides

An instance of a Python dict.

TenjintShell.history_length

An int trait.

TenjintShell.history_load_length

An int trait.

TenjintShell.history_manager

A trait whose value must be an instance of a specified class.

TenjintShell.init_syntax_highlighting

TenjintShell.init_term_title

TenjintShell.input_splitter

A trait whose value must be an instance of a specified class.

TenjintShell.input_transformer_manager

A trait whose value must be an instance of a specified class.

TenjintShell.ipython_dir

A trait for unicode strings.

TenjintShell.last_execution_result

A trait whose value must be an instance of a specified class.

TenjintShell.last_execution_succeeded

A boolean (True, False) trait.

TenjintShell.log

A trait whose value must be an instance of a specified class.

TenjintShell.logappend

A trait for unicode strings.

TenjintShell.logfile

A trait for unicode strings.

TenjintShell.logstart

A boolean (True, False) trait.

TenjintShell.magics_manager

A trait whose value must be an instance of a specified class.

TenjintShell.mouse_support

A boolean (True, False) trait.

TenjintShell.object_info_string_level

An enum whose value must be in a given sequence.

TenjintShell.parent

A trait whose value must be an instance of a specified class.

TenjintShell.payload_manager

A trait whose value must be an instance of a specified class.

TenjintShell.pdb

A boolean (True, False) trait.

TenjintShell.prefilter_manager

A trait whose value must be an instance of a specified class.

TenjintShell.profile

TenjintShell.profile_dir

A trait whose value must be an instance of a specified class.

TenjintShell.prompt_in1

A trait for unicode strings.

TenjintShell.prompt_in2

A trait for unicode strings.

TenjintShell.prompt_out

A trait for unicode strings.

TenjintShell.prompts

A trait whose value must be an instance of a specified class.

TenjintShell.prompts_class

A trait whose value must be a subclass of a specified class.

TenjintShell.prompts_pad_left

A boolean (True, False) trait.

TenjintShell.pt_cli

TenjintShell.pylab_gui_select

TenjintShell.quiet

A boolean (True, False) trait.

TenjintShell.rl_next_input

TenjintShell.separate_in

A Unicode subclass to validate separate_in, separate_out, etc.

TenjintShell.separate_out

A Unicode subclass to validate separate_in, separate_out, etc.

TenjintShell.separate_out2

A Unicode subclass to validate separate_in, separate_out, etc.

TenjintShell.should_raise

A casting version of the boolean trait.

TenjintShell.show_rewritten_input

A boolean (True, False) trait.

TenjintShell.simple_prompt

A boolean (True, False) trait.

TenjintShell.space_for_menu

An int trait.

TenjintShell.sphinxify_docstring

A boolean (True, False) trait.

TenjintShell.term_title

A boolean (True, False) trait.

TenjintShell.term_title_format

A trait for unicode strings.

TenjintShell.true_color

A boolean (True, False) trait.

TenjintShell.user_global_ns

TenjintShell.utf8_banner

TenjintShell.wildcards_case_sensitive

A boolean (True, False) trait.

TenjintShell.xmode

An enum of strings where the case should be ignored.

Methods

TenjintShell.__init__(**kwargs)

Create a configurable given a config config.

TenjintShell.add_traits(**traits)

Dynamically add trait attributes to the HasTraits instance.

TenjintShell.ask_exit()

TenjintShell.ask_yes_no(prompt[, default, …])

TenjintShell.atexit_operations()

This will be executed at the time of exit.

TenjintShell.auto_rewrite_input(cmd)

Overridden from the parent class to use fancy rewriting prompt

TenjintShell.check_complete(code)

Return whether a block of code is ready to execute, or should be continued

TenjintShell.class_config_rst_doc()

Generate rST documentation for this class’ config options.

TenjintShell.class_config_section()

Get the config class config section

TenjintShell.class_get_help([inst])

Get the help string for this class in ReST format.

TenjintShell.class_get_trait_help(trait[, inst])

Get the help string for a single trait.

TenjintShell.class_own_trait_events(name)

Get a dict of all event handlers defined on this class, not a parent.

TenjintShell.class_own_traits(**metadata)

Get a dict of all the traitlets defined on this class, not a parent.

TenjintShell.class_print_help([inst])

Get the help string for a single trait and print it.

TenjintShell.class_trait_names(**metadata)

Get a list of all the names of this class’ traits.

TenjintShell.class_traits(**metadata)

Get a dict of all the traits of this class.

TenjintShell.cleanup()

TenjintShell.clear_instance()

unset _instance for this class and singleton parents.

TenjintShell.clear_main_mod_cache()

Clear the cache of main modules.

TenjintShell.complete(text[, line, cursor_pos])

Return the completed text and a list of completions.

TenjintShell.debugger([force])

Call the pdb debugger.

TenjintShell.define_macro(name, themacro)

Define a new macro

TenjintShell.del_var(varname[, by_name])

Delete a variable from the various namespaces, so that, as far as possible, we’re not keeping any hidden references to it.

TenjintShell.drop_by_id(variables)

Remove a dict of variables from the user namespace, if they are the same as the values in the dictionary.

TenjintShell.enable_gui([gui])

TenjintShell.enable_matplotlib([gui])

Enable interactive matplotlib and inline figure support.

TenjintShell.enable_pylab([gui, import_all, …])

Activate pylab support at runtime.

TenjintShell.enable_win_unicode_console()

TenjintShell.ev(expr)

Evaluate python expression expr in user namespace.

TenjintShell.ex(cmd)

Execute a normal python statement in user namespace.

TenjintShell.excepthook(etype, value, tb)

One more defense for GUI apps that call sys.excepthook.

TenjintShell.extract_input_lines(range_str)

Return as a string a set of input history slices.

TenjintShell.find_cell_magic(magic_name)

Find and return a cell magic by name.

TenjintShell.find_line_magic(magic_name)

Find and return a line magic by name.

TenjintShell.find_magic(magic_name[, magic_kind])

Find and return a magic of the given type by name.

TenjintShell.find_user_code(target[, raw, …])

Get a code string from history, file, url, or a string or macro.

TenjintShell.get_exception_only([exc_tuple])

Return as a string (ending with a newline) the exception that just occurred, without any traceback.

TenjintShell.get_ipython()

Return the currently running IPython instance.

TenjintShell.getoutput(cmd[, split, depth])

Get output (possibly including stderr) from a subprocess.

TenjintShell.has_trait(name)

Returns True if the object has a trait with the specified name.

TenjintShell.hold_trait_notifications()

Context manager for bundling trait change notifications and cross validation.

TenjintShell.init_alias()

TenjintShell.init_builtins()

TenjintShell.init_completer()

Initialize the completion machinery.

TenjintShell.init_create_namespaces([…])

TenjintShell.init_data_pub()

TenjintShell.init_deprecation_warnings()

register default filter for deprecation warning.

TenjintShell.init_display_formatter()

TenjintShell.init_display_pub()

TenjintShell.init_displayhook()

TenjintShell.init_encoding()

TenjintShell.init_environment()

Any changes we need to make to the user’s environment.

TenjintShell.init_events()

TenjintShell.init_extension_manager()

TenjintShell.init_history()

Sets up the command history, and starts regular autosaves.

TenjintShell.init_hooks()

TenjintShell.init_inspector()

TenjintShell.init_instance_attrs()

TenjintShell.init_io()

TenjintShell.init_ipython_dir(ipython_dir)

TenjintShell.init_logger()

TenjintShell.init_logstart()

Initialize logging in case it was requested at the command line.

TenjintShell.init_magics()

TenjintShell.init_payload()

TenjintShell.init_pdb()

TenjintShell.init_prefilter()

TenjintShell.init_profile_dir(profile_dir)

TenjintShell.init_prompt_toolkit_cli()

TenjintShell.init_prompts()

TenjintShell.init_pushd_popd_magic()

TenjintShell.init_readline()

DEPRECATED

TenjintShell.init_sys_modules()

Explicitly overwrite IPython.core.interactiveshell to do nothing.

TenjintShell.init_traceback_handlers(…)

TenjintShell.init_user_ns()

Initialize all user-visible namespaces to their minimum defaults.

TenjintShell.init_virtualenv()

Add a virtualenv to sys.path so the user can import modules from it.

TenjintShell.initialized()

Has an instance been created?

TenjintShell.inputhook(context)

TenjintShell.instance(*args, **kwargs)

Returns a global instance of this class.

TenjintShell.interact([display_banner])

TenjintShell.magic(arg_s)

DEPRECATED.

TenjintShell.mainloop([local_ns, module, …])

Embeds IPython into a running python program.

TenjintShell.mktempfile([data, prefix])

Make a new tempfile and return its filename.

TenjintShell.new_main_mod(filename, modname)

Return a new ‘main’ module object for user code execution.

TenjintShell.notify_change(change)

TenjintShell.object_inspect(oname[, …])

Get object info about oname

TenjintShell.object_inspect_mime(oname[, …])

Get object info as a mimebundle of formatted representations.

TenjintShell.object_inspect_text(oname[, …])

Get object info as formatted text

TenjintShell.observe(handler[, names, type])

Setup a handler to be called when a trait changes.

TenjintShell.on_trait_change([handler, …])

DEPRECATED: Setup a handler to be called when a trait changes.

TenjintShell.pre_prompt()

TenjintShell.prepare_user_module([…])

Prepare the module and namespace in which user code will be run.

TenjintShell.prompt_for_code()

TenjintShell.push(variables[, interactive])

Inject a group of variables into the IPython user namespace.

TenjintShell.refresh_style()

TenjintShell.register_magic_function(func[, …])

Expose a standalone function as magic function for IPython.

TenjintShell.register_post_execute(func)

DEPRECATED: Use ip.events.register(‘post_run_cell’, func)

TenjintShell.reset([new_session])

Clear all internal namespaces, and attempt to release references to user objects.

TenjintShell.reset_selective([regex])

Clear selective variables from internal namespaces based on a specified regular expression.

TenjintShell.restore_sys_module_state()

Restore the state of the sys module.

TenjintShell.run_ast_nodes(nodelist, cell_name)

Run a sequence of AST nodes.

TenjintShell.run_cell(raw_cell[, …])

Run a complete IPython cell.

TenjintShell.run_cell_magic(magic_name, …)

Execute the given cell magic.

TenjintShell.run_code(code_obj[, result])

Execute a code object.

TenjintShell.run_line_magic(magic_name, line)

Execute the given line magic.

TenjintShell.runcode(code_obj[, result])

Execute a code object.

TenjintShell.safe_execfile(fname, *where[, …])

A safe version of the builtin execfile().

TenjintShell.safe_execfile_ipy(fname[, …])

Like safe_execfile, but for .ipy or .ipynb files with IPython syntax.

TenjintShell.safe_run_module(mod_name, where)

A safe version of runpy.run_module().

TenjintShell.save_sys_module_state()

Save the state of hooks in the sys module.

TenjintShell.section_names()

return section names as a list

TenjintShell.set_autoindent([value])

Set the autoindent flag.

TenjintShell.set_completer_frame([frame])

Set the frame of the completer.

TenjintShell.set_custom_completer(completer)

Adds a new custom completer function.

TenjintShell.set_custom_exc(exc_tuple, handler)

Set a custom exception handler, which will be called if any of the exceptions in exc_tuple occur in the mainloop (specifically, in the run_code() method).

TenjintShell.set_hook(name,hook)

IPython exposes some of its internal API as user-modifiable hooks.

TenjintShell.set_next_input(s[, replace])

Sets the ‘default’ input string for the next command line.

TenjintShell.set_trait(name, value)

Forcibly sets trait attribute, including read-only attributes.

TenjintShell.setup_instance(*args, **kwargs)

This is called before self.__init__ is called.

TenjintShell.show_banner([banner])

TenjintShell.show_usage()

Show a usage message

TenjintShell.show_usage_error(exc)

Show a short message for UsageErrors

TenjintShell.showindentationerror()

Called by _run_cell when there’s an IndentationError in code entered at the prompt.

TenjintShell.showsyntaxerror([filename, …])

Display the syntax error that just occurred.

TenjintShell.showtraceback([exc_tuple, …])

Display the exception that just occurred.

TenjintShell.switch_doctest_mode(mode)

Switch prompts to classic for %doctest_mode

TenjintShell.system(cmd)

Call the given cmd in a subprocess using os.system on Windows or subprocess.call using the system shell on other platforms.

TenjintShell.system_piped(cmd)

Call the given cmd in a subprocess, piping stdout/err

TenjintShell.system_raw(cmd)

Call the given cmd in a subprocess using os.system on Windows or subprocess.call using the system shell on other platforms.

TenjintShell.trait_events([name])

Get a dict of all the event handlers of this class.

TenjintShell.trait_metadata(traitname, key)

Get metadata values for trait by key.

TenjintShell.trait_names(**metadata)

Get a list of all the names of this class’ traits.

TenjintShell.traits(**metadata)

Get a dict of all the traits of this class.

TenjintShell.transform_ast(node)

Apply the AST transformations from self.ast_transformers

TenjintShell.unobserve(handler[, names, type])

Remove a trait change handler.

TenjintShell.unobserve_all([name])

Remove trait change handlers of any type for the specified name.

TenjintShell.update_config(config)

Update config and load the new values

TenjintShell.user_expressions(expressions)

Evaluate a dict of expressions in the user’s namespace.

TenjintShell.var_expand(cmd[, depth, formatter])

Expand python variables in a string.

TenjintShell.write(data)

DEPRECATED: Write a string to the default output

TenjintShell.write_err(data)

DEPRECATED: Write a string to the default error output