Show More
@@ -150,6 +150,8 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 | b = self.cleanup_input(block) |
|
155 | b = self.cleanup_input(block) | |
154 | if name: |
|
156 | if name: | |
155 | # If storing it for further editing |
|
157 | # If storing it for further editing | |
@@ -348,6 +350,8 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
348 | help="Enable auto setting the terminal title." |
|
350 | help="Enable auto setting the terminal title." | |
349 | ) |
|
351 | ) | |
350 |
|
352 | |||
|
353 | using_magics = CBool(False) | |||
|
354 | ||||
351 | # In the terminal, GUI control is done via PyOS_InputHook |
|
355 | # In the terminal, GUI control is done via PyOS_InputHook | |
352 | from IPython.lib.inputhook import enable_gui |
|
356 | from IPython.lib.inputhook import enable_gui | |
353 | enable_gui = staticmethod(enable_gui) |
|
357 | enable_gui = staticmethod(enable_gui) | |
@@ -721,8 +725,9 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
721 |
|
725 | |||
722 | def showindentationerror(self): |
|
726 | def showindentationerror(self): | |
723 | super(TerminalInteractiveShell, self).showindentationerror() |
|
727 | super(TerminalInteractiveShell, self).showindentationerror() | |
724 | print("If you want to paste code into IPython, try the " |
|
728 | if not self.using_magics: | |
725 | "%paste and %cpaste magic functions.") |
|
729 | print("If you want to paste code into IPython, try the " | |
|
730 | "%paste and %cpaste magic functions.") | |||
726 |
|
731 | |||
727 |
|
732 | |||
728 | InteractiveShellABC.register(TerminalInteractiveShell) |
|
733 | InteractiveShellABC.register(TerminalInteractiveShell) |
General Comments 0
You need to be logged in to leave comments.
Login now