##// END OF EJS Templates
Use new input transformation API in %paste...
Thomas Kluyver -
Show More
@@ -150,14 +150,13 b' class TerminalMagics(Magics):'
150 150 def store_or_execute(self, block, name):
151 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 153 if name:
156 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 156 print("Block assigned to '%s'" % name)
159 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 160 self.shell.using_paste_magics = True
162 161 try:
163 162 self.shell.run_cell(b)
General Comments 0
You need to be logged in to leave comments. Login now