MCPcopy Index your code
hub / github.com/ipython/ipython / in_prompt_tokens

Method in_prompt_tokens

IPython/terminal/prompts.py:37–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35 return 0
36
37 def in_prompt_tokens(self):
38 return [
39 (Token.Prompt.Mode, self.vi_mode()),
40 (
41 Token.Prompt.LineNumber,
42 self.shell.prompt_line_number_format.format(
43 line=1, rel_line=-self.current_line()
44 ),
45 ),
46 (Token.Prompt, "In ["),
47 (Token.PromptNum, str(self.shell.execution_count)),
48 (Token.Prompt, ']: '),
49 ]
50
51 def _width(self):
52 return fragment_list_width(self.in_prompt_tokens())

Callers 3

_widthMethod · 0.95
promptMethod · 0.45
get_messageMethod · 0.45

Calls 3

vi_modeMethod · 0.95
current_lineMethod · 0.95
formatMethod · 0.45

Tested by

no test coverage detected