MCPcopy Index your code
hub / github.com/prompt-toolkit/ptpython / IPythonPrompt

Class IPythonPrompt

src/ptpython/ipython.py:49–64  ·  view source on GitHub ↗

Style for IPython >5.0, use the prompt_toolkit tokens directly.

Source from the content-addressed store, hash-verified

47
48
49class 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
67class IPythonValidator(PythonValidator):

Callers 2

__init__Method · 0.70
__init__Method · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected