Style for IPython >5.0, use the prompt_toolkit tokens directly.
| 47 | |
| 48 | |
| 49 | class IPythonPrompt(PromptStyle): |
| 50 | """ |
| 51 | Style for IPython >5.0, use the prompt_toolkit tokens directly. |
| 52 | """ |
| 53 | |
| 54 | def __init__(self, prompts): |
| 55 | self.prompts = prompts |
| 56 | |
| 57 | def in_prompt(self) -> AnyFormattedText: |
| 58 | return PygmentsTokens(self.prompts.in_prompt_tokens()) |
| 59 | |
| 60 | def in2_prompt(self, width: int) -> AnyFormattedText: |
| 61 | return PygmentsTokens(self.prompts.continuation_prompt_tokens()) |
| 62 | |
| 63 | def out_prompt(self) -> AnyFormattedText: |
| 64 | return [] |
| 65 | |
| 66 | |
| 67 | class IPythonValidator(PythonValidator): |