##// END OF EJS Templates
fix for #10327 : get_ipython().magic() replaced with get_ipython().run_line_magic()
adityausathe -
Show More
@@ -198,11 +198,14 b' def _make_help_call(target, esc, lspace, next_input=None):'
198 else 'psearch' if '*' in target \
198 else 'psearch' if '*' in target \
199 else 'pinfo'
199 else 'pinfo'
200 arg = " ".join([method, target])
200 arg = " ".join([method, target])
201 #Prepare arguments for get_ipython().run_line_magic(magic_name, magic_args)
202 t_magic_name, _, t_magic_arg_s = arg.partition(' ')
203 t_magic_name = t_magic_name.lstrip(ESC_MAGIC)
201 if next_input is None:
204 if next_input is None:
202 return '%sget_ipython().magic(%r)' % (lspace, arg)
205 return '%sget_ipython().run_line_magic(%r, %r)' % (lspace, t_magic_name, t_magic_arg_s)
203 else:
206 else:
204 return '%sget_ipython().set_next_input(%r);get_ipython().magic(%r)' % \
207 return '%sget_ipython().set_next_input(%r);get_ipython().run_line_magic(%r, %r)' % \
205 (lspace, next_input, arg)
208 (lspace, next_input, t_magic_name, t_magic_arg_s)
206
209
207 # These define the transformations for the different escape characters.
210 # These define the transformations for the different escape characters.
208 def _tr_system(line_info):
211 def _tr_system(line_info):
@@ -526,6 +529,6 b' def assign_from_magic(line):'
526 return line
529 return line
527 #Prepare arguments for get_ipython().run_line_magic(magic_name, magic_args)
530 #Prepare arguments for get_ipython().run_line_magic(magic_name, magic_args)
528 m_lhs, m_cmd = m.group('lhs', 'cmd')
531 m_lhs, m_cmd = m.group('lhs', 'cmd')
529 t_magic_name, _, t_magic_arg_s = cmd.partition(' ')
532 t_magic_name, _, t_magic_arg_s = m_cmd.partition(' ')
530 t_magic_name = t_magic_name.lstrip(ESC_MAGIC)
533 t_magic_name = t_magic_name.lstrip(ESC_MAGIC)
531 return assign_magic_template % (m_lhs, t_magic_name, t_magic_arg_s)
534 return assign_magic_template % (m_lhs, t_magic_name, t_magic_arg_s)
General Comments 0
You need to be logged in to leave comments. Login now