Rerun a previously pasted command.
(self, name='pasted_block')
| 64 | return strip_email_quotes('\n'.join(lines)) |
| 65 | |
| 66 | def rerun_pasted(self, name='pasted_block'): |
| 67 | """ Rerun a previously pasted command. |
| 68 | """ |
| 69 | b = self.shell.user_ns.get(name) |
| 70 | |
| 71 | # Sanity checks |
| 72 | if b is None: |
| 73 | raise UsageError('No previous pasted block available') |
| 74 | if not isinstance(b, str): |
| 75 | raise UsageError( |
| 76 | "Variable 'pasted_block' is not a string, can't execute") |
| 77 | |
| 78 | print("Re-executing '%s...' (%d chars)"% (b.split('\n',1)[0], len(b))) |
| 79 | self.shell.run_cell(b) |
| 80 | |
| 81 | @line_magic |
| 82 | def autoindent(self, parameter_s = ''): |
no test coverage detected