Show More
@@ -150,7 +150,6 b' class TerminalMagics(Magics):' | |||||
150 | def store_or_execute(self, block, name): |
|
150 | def store_or_execute(self, block, name): | |
151 | """ Execute a block, or store it in a variable, per the user's request. |
|
151 | """ Execute a block, or store it in a variable, per the user's request. | |
152 | """ |
|
152 | """ | |
153 | self.shell.using_magics = True |
|
|||
154 |
|
153 | |||
155 | b = self.cleanup_input(block) |
|
154 | b = self.cleanup_input(block) | |
156 | if name: |
|
155 | if name: | |
@@ -159,7 +158,9 b' class TerminalMagics(Magics):' | |||||
159 | print("Block assigned to '%s'" % name) |
|
158 | print("Block assigned to '%s'" % name) | |
160 | else: |
|
159 | else: | |
161 | self.shell.user_ns['pasted_block'] = b |
|
160 | self.shell.user_ns['pasted_block'] = b | |
|
161 | self.shell.using_paste_magics = True | |||
162 | self.shell.run_cell(b) |
|
162 | self.shell.run_cell(b) | |
|
163 | self.shell.using_paste_magics = True | |||
163 |
|
164 | |||
164 | def rerun_pasted(self, name='pasted_block'): |
|
165 | def rerun_pasted(self, name='pasted_block'): | |
165 | """ Rerun a previously pasted command. |
|
166 | """ Rerun a previously pasted command. | |
@@ -350,7 +351,9 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
350 | help="Enable auto setting the terminal title." |
|
351 | help="Enable auto setting the terminal title." | |
351 | ) |
|
352 | ) | |
352 |
|
353 | |||
353 | using_magics = CBool(False) |
|
354 | # This `using_paste_magics` is used to detect whether the code is being | |
|
355 | # executed via paste magics functions | |||
|
356 | using_paste_magics = CBool(False) | |||
354 |
|
357 | |||
355 | # In the terminal, GUI control is done via PyOS_InputHook |
|
358 | # In the terminal, GUI control is done via PyOS_InputHook | |
356 | from IPython.lib.inputhook import enable_gui |
|
359 | from IPython.lib.inputhook import enable_gui |
General Comments 0
You need to be logged in to leave comments.
Login now