Show More
@@ -3187,11 +3187,14 b' Defaulting color scheme to \'NoColor\'"""' | |||||
3187 | from IPython.core import interactiveshell |
|
3187 | from IPython.core import interactiveshell | |
3188 | print "Pasting code; enter '%s' alone on the line to stop." % sentinel |
|
3188 | print "Pasting code; enter '%s' alone on the line to stop." % sentinel | |
3189 | while True: |
|
3189 | while True: | |
3190 | l = self.shell.raw_input_original(':') |
|
3190 | try: | |
3191 | if l == sentinel: |
|
3191 | l = self.shell.raw_input_original(':') | |
|
3192 | if l == sentinel: | |||
|
3193 | return | |||
|
3194 | else: | |||
|
3195 | yield l | |||
|
3196 | except EOFError: | |||
3192 | return |
|
3197 | return | |
3193 | else: |
|
|||
3194 | yield l |
|
|||
3195 |
|
3198 | |||
3196 | def _strip_pasted_lines_for_code(self, raw_lines): |
|
3199 | def _strip_pasted_lines_for_code(self, raw_lines): | |
3197 | """ Strip non-code parts of a sequence of lines to return a block of |
|
3200 | """ Strip non-code parts of a sequence of lines to return a block of |
@@ -487,7 +487,7 b' class TerminalInteractiveShell(InteractiveShell):' | |||||
487 | def magic_cpaste(self, parameter_s=''): |
|
487 | def magic_cpaste(self, parameter_s=''): | |
488 | """Paste & execute a pre-formatted code block from clipboard. |
|
488 | """Paste & execute a pre-formatted code block from clipboard. | |
489 |
|
489 | |||
490 | You must terminate the block with '--' (two minus-signs) alone on the |
|
490 | You must terminate the block with '--' (two minus-signs) or Ctrl-D alone on the | |
491 | line. You can also provide your own sentinel with '%paste -s %%' ('%%' |
|
491 | line. You can also provide your own sentinel with '%paste -s %%' ('%%' | |
492 | is the new sentinel for this operation) |
|
492 | is the new sentinel for this operation) | |
493 |
|
493 |
General Comments 0
You need to be logged in to leave comments.
Login now