hyperspyui.widgets.consolewidget module

Created on Tue Nov 04 16:04:17 2014

@author: Vidar Tonaas Fauske

class hyperspyui.widgets.consolewidget.ConsoleWidget(**kwargs: Any)

Bases: RichJupyterWidget

_all_trait_default_generators: dict[str, t.Any] = {'_display_banner': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, '_highlighter': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, '_jpg_supported': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'ansi_codes': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'banner': <traitlets.traitlets.DefaultHandler object>, 'buffer_size': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'clear_on_kernel_restart': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'config': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'confirm_restart': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'console_height': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'console_width': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'custom_edit': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'custom_interrupt': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'custom_restart': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'editor': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'editor_line': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'enable_calltips': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'execute_on_complete_input': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'font_family': <function ConsoleWidget._font_family_default>, 'font_size': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'gui_completion': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'gui_completion_height': <bound method TraitType.default of <traitlets.traitlets.Int object>>, 'history_lock': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'in_prompt': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'include_other_output': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'input_sep': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'kernel_banner': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'kind': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'lexer': <function FrontendWidget._lexer_default>, 'lexer_class': <function FrontendWidget._lexer_class_default>, 'log': <traitlets.traitlets.DefaultHandler object>, 'other_output_prefix': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'out_prompt': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'output_sep': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'output_sep2': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'override_shortcuts': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'paging': <bound method TraitType.default of <traitlets.traitlets.Enum object>>, 'parent': <bound method TraitType.default of <traitlets.traitlets.Instance object>>, 'scrollbar_visibility': <bound method TraitType.default of <traitlets.traitlets.Bool object>>, 'style_sheet': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>, 'syntax_style': <bound method TraitType.default of <traitlets.traitlets.Unicode object>>}
_descriptors = [<traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.DefaultHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ObserveHandler object>, <traitlets.traitlets.ValidateHandler object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Int object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Any object>, <traitlets.traitlets.DottedObjectName object>, <traitlets.traitlets.Any object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Enum object>, <traitlets.traitlets.Instance object>, <traitlets.traitlets.Bool object>, <traitlets.traitlets.Unicode object>, <traitlets.traitlets.Unicode object>]
_execute(source, hidden)

Execute ‘source’. If ‘hidden’, do not show any output.

See parent class execute() docstring for full details.

Overriden copy to move ‘executing’ event before it is actually executed

_instance_inits = [<bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DefaultHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ObserveHandler.instance_init of <traitlets.traitlets.ObserveHandler object>>, <bound method ValidateHandler.instance_init of <traitlets.traitlets.ValidateHandler object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>, <bound method BaseDescriptor.instance_init of <traitlets.traitlets.DottedObjectName object>>, <bound method Instance.instance_init of <traitlets.traitlets.Instance object>>]
_static_immutable_initial_values: dict[str, t.Any] = {'_display_banner': False, '_highlighter': None, '_jpg_supported': False, 'ansi_codes': True, 'buffer_size': 500, 'clear_on_kernel_restart': True, 'confirm_restart': True, 'console_height': 25, 'console_width': 81, 'custom_edit': False, 'custom_interrupt': False, 'custom_restart': False, 'editor': '', 'editor_line': '', 'enable_calltips': True, 'execute_on_complete_input': True, 'font_size': 0, 'gui_completion_height': 0, 'history_lock': False, 'in_prompt': 'In [<span class="in-prompt-number">%i</span>]: ', 'include_other_output': False, 'input_sep': '\n', 'kernel_banner': '', 'other_output_prefix': '[remote] ', 'out_prompt': 'Out[<span class="out-prompt-number">%i</span>]: ', 'output_sep': '', 'output_sep2': '', 'override_shortcuts': False, 'parent': None, 'scrollbar_visibility': True, 'style_sheet': '', 'syntax_style': ''}
_trait_default_generators = {}
_traits: dict[str, t.Any] = {'_display_banner': <traitlets.traitlets.Bool object>, '_highlighter': <traitlets.traitlets.Instance object>, '_jpg_supported': <traitlets.traitlets.Bool object>, 'ansi_codes': <traitlets.traitlets.Bool object>, 'banner': <traitlets.traitlets.Unicode object>, 'buffer_size': <traitlets.traitlets.Int object>, 'clear_on_kernel_restart': <traitlets.traitlets.Bool object>, 'config': <traitlets.traitlets.Instance object>, 'confirm_restart': <traitlets.traitlets.Bool object>, 'console_height': <traitlets.traitlets.Int object>, 'console_width': <traitlets.traitlets.Int object>, 'custom_edit': <traitlets.traitlets.Bool object>, 'custom_interrupt': <traitlets.traitlets.Bool object>, 'custom_restart': <traitlets.traitlets.Bool object>, 'editor': <traitlets.traitlets.Unicode object>, 'editor_line': <traitlets.traitlets.Unicode object>, 'enable_calltips': <traitlets.traitlets.Bool object>, 'execute_on_complete_input': <traitlets.traitlets.Bool object>, 'font_family': <traitlets.traitlets.Unicode object>, 'font_size': <traitlets.traitlets.Int object>, 'gui_completion': <traitlets.traitlets.Enum object>, 'gui_completion_height': <traitlets.traitlets.Int object>, 'history_lock': <traitlets.traitlets.Bool object>, 'in_prompt': <traitlets.traitlets.Unicode object>, 'include_other_output': <traitlets.traitlets.Bool object>, 'input_sep': <traitlets.traitlets.Unicode object>, 'kernel_banner': <traitlets.traitlets.Unicode object>, 'kind': <traitlets.traitlets.Enum object>, 'lexer': <traitlets.traitlets.Any object>, 'lexer_class': <traitlets.traitlets.DottedObjectName object>, 'log': <traitlets.traitlets.Any object>, 'other_output_prefix': <traitlets.traitlets.Unicode object>, 'out_prompt': <traitlets.traitlets.Unicode object>, 'output_sep': <traitlets.traitlets.Unicode object>, 'output_sep2': <traitlets.traitlets.Unicode object>, 'override_shortcuts': <traitlets.traitlets.Bool object>, 'paging': <traitlets.traitlets.Enum object>, 'parent': <traitlets.traitlets.Instance object>, 'scrollbar_visibility': <traitlets.traitlets.Bool object>, 'style_sheet': <traitlets.traitlets.Unicode object>, 'syntax_style': <traitlets.traitlets.Unicode object>}
ex(source)
push(variables)
hyperspyui.widgets.consolewidget._init_asyncio_patch()

set default asyncio policy to be compatible with tornado Tornado 6 (at least) is not compatible with the default asyncio implementation on Windows

Pick the older SelectorEventLoopPolicy on Windows if the known-incompatible default policy is in use. do this as early as possible to make it a low priority and overrideable

ref: https://github.com/tornadoweb/tornado/issues/2608 FIXME: if/when tornado supports the defaults in asyncio, remove and bump tornado requirement for py38