MCPcopy Index your code
hub / github.com/python-cmd2/cmd2 / _set_prompt

Method _set_prompt

examples/python_scripting.py:42–45  ·  view source on GitHub ↗

Set prompt so it displays the current working directory.

(self)

Source from the content-addressed store, hash-verified

40 self.intro = "Happy 𝛑 Day. Note the full Unicode support: 😇 💩"
41
42 def _set_prompt(self) -> None:
43 """Set prompt so it displays the current working directory."""
44 self.cwd = os.getcwd()
45 self.prompt = stylize(f"{self.cwd} $ ", style=Color.CYAN)
46
47 def postcmd(self, stop: bool, _line: str) -> bool:
48 """Hook method executed just after a command dispatch is finished.

Callers 2

__init__Method · 0.95
postcmdMethod · 0.95

Calls 1

stylizeFunction · 0.90

Tested by

no test coverage detected