Move the retrieval and assembly of the prompt string fragment for
active state users into its own method, paving the way for more
dynamic and extensible prompts.
self.error = False
self.adjust_echoing()
+ def prompt(self):
+ """"Generate and return an input prompt."""
+ return self.account.get("prompt", ">") + " "
+
def adjust_echoing(self):
"""Adjust echoing to match state menu requirements."""
if mudpy.telnet.is_enabled(self, mudpy.telnet.TELOPT_ECHO,
if not just_prompt:
output += "$(eol)"
if add_prompt:
- output += self.account.get("prompt", ">") + " "
+ output += self.prompt()
mode = self.avatar.get("mode")
if mode:
output += "(" + mode + ") "