MCPcopy Create free account
hub / github.com/ipython/ipython / _make_help_call

Function _make_help_call

IPython/core/inputtransformer.py:196–210  ·  view source on GitHub ↗

Prepares a pinfo(2)/psearch call from a target name and the escape (i.e. ? or ??)

(target, esc, lspace, next_input=None)

Source from the content-addressed store, hash-verified

194
195# Utilities
196def _make_help_call(target, esc, lspace, next_input=None):
197 """Prepares a pinfo(2)/psearch call from a target name and the escape
198 (i.e. ? or ??)"""
199 method = 'pinfo2' if esc == '??' \
200 else 'psearch' if '*' in target \
201 else 'pinfo'
202 arg = " ".join([method, target])
203 #Prepare arguments for get_ipython().run_line_magic(magic_name, magic_args)
204 t_magic_name, _, t_magic_arg_s = arg.partition(' ')
205 t_magic_name = t_magic_name.lstrip(ESC_MAGIC)
206 if next_input is None:
207 return '%sget_ipython().run_line_magic(%r, %r)' % (lspace, t_magic_name, t_magic_arg_s)
208 else:
209 return '%sget_ipython().set_next_input(%r);get_ipython().run_line_magic(%r, %r)' % \
210 (lspace, next_input, t_magic_name, t_magic_arg_s)
211
212# These define the transformations for the different escape characters.
213def _tr_system(line_info):

Callers 2

_tr_helpFunction · 0.70
help_endFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected