Prepares a pinfo(2)/psearch call from a target name and the escape (i.e. ? or ??)
(target, esc)
| 430 | ESCAPE_DOUBLES = {'!!', '??'} # %% (cell magic) is handled separately |
| 431 | |
| 432 | def _make_help_call(target, esc): |
| 433 | """Prepares a pinfo(2)/psearch call from a target name and the escape |
| 434 | (i.e. ? or ??)""" |
| 435 | method = 'pinfo2' if esc == '??' \ |
| 436 | else 'psearch' if '*' in target \ |
| 437 | else 'pinfo' |
| 438 | arg = " ".join([method, target]) |
| 439 | #Prepare arguments for get_ipython().run_line_magic(magic_name, magic_args) |
| 440 | t_magic_name, _, t_magic_arg_s = arg.partition(' ') |
| 441 | t_magic_name = t_magic_name.lstrip(ESC_MAGIC) |
| 442 | return "get_ipython().run_line_magic(%r, %r)" % (t_magic_name, t_magic_arg_s) |
| 443 | |
| 444 | |
| 445 | def _tr_help(content): |