Strip the >>>/... prompts of the Python interactive shell.
()
| 454 | |
| 455 | @CoroutineInputTransformer.wrap |
| 456 | def classic_prompt(): |
| 457 | """Strip the >>>/... prompts of the Python interactive shell.""" |
| 458 | # FIXME: non-capturing version (?:...) usable? |
| 459 | prompt_re = re.compile(r'^(>>>|\.\.\.)( |$)') |
| 460 | initial_re = re.compile(r'^>>>( |$)') |
| 461 | # Any %magic/!system is IPython syntax, so we needn't look for >>> prompts |
| 462 | turnoff_re = re.compile(r'^[%!]') |
| 463 | return _strip_prompts(prompt_re, initial_re, turnoff_re) |
| 464 | |
| 465 | @CoroutineInputTransformer.wrap |
| 466 | def ipy_prompt(): |
no test coverage detected