MCPcopy Index your code
hub / github.com/ipython/ipython / init_hooks

Method init_hooks

IPython/core/interactiveshell.py:1057–1071  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1055 #-------------------------------------------------------------------------
1056
1057 def init_hooks(self):
1058 # hooks holds pointers used for user-side customizations
1059 self.hooks = Struct()
1060
1061 self.strdispatchers = {}
1062
1063 # Set all default hooks, defined in the IPython.hooks module.
1064 hooks = IPython.core.hooks
1065 for hook_name in hooks.__all__:
1066 # default hooks have priority 100, i.e. low; user hooks should have
1067 # 0-100 priority
1068 self.set_hook(hook_name, getattr(hooks, hook_name), 100)
1069
1070 if self.display_page:
1071 self.set_hook('show_in_pager', page.as_hook(page.display_page), 90)
1072
1073 def set_hook(self, name, hook, priority=50, str_key=None, re_key=None):
1074 """set_hook(name,hook) -> sets an internal IPython hook.

Callers 1

__init__Method · 0.95

Calls 2

set_hookMethod · 0.95
StructClass · 0.90

Tested by

no test coverage detected