##// END OF EJS Templates
Use new input transformation API in %paste...
Thomas Kluyver -
Show More
@@ -150,14 +150,13 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
154 b = self.cleanup_input(block)
155 if name:
153 if name:
156 # If storing it for further editing
154 # If storing it for further editing
157 self.shell.user_ns[name] = SList(b.splitlines())
155 self.shell.user_ns[name] = SList(block.splitlines())
158 print("Block assigned to '%s'" % name)
156 print("Block assigned to '%s'" % name)
159 else:
157 else:
160 self.shell.user_ns['pasted_block'] = b
158 self.shell.user_ns['pasted_block'] = block
159 b = self.shell.input_transformer_manager.transform_cell(block)
161 self.shell.using_paste_magics = True
160 self.shell.using_paste_magics = True
162 try:
161 try:
163 self.shell.run_cell(b)
162 self.shell.run_cell(b)
General Comments 0
You need to be logged in to leave comments. Login now