if not prompt:
return get_menu_prompt(self.state)
+ # Allow including the World clock state
+ if "$_(time)" in prompt:
+ prompt = prompt.replace(
+ "$_(time)",
+ str(universe.groups["internal"]["counters"].get("elapsed")))
+
+ # Append a single space for clear separation from user input
+ if prompt[-1] != " ":
+ prompt = "%s " % prompt
+
# Return the cooked prompt
- return "%s " % prompt
+ return prompt
def adjust_echoing(self):
"""Adjust echoing to match state menu requirements."""
(0, "> ", "preferences"),
(0, r"prompt \x1b\[32m.*> ", "preferences prompt $(foo)"),
(0, r"\$\(foo\) ", "preferences prompt"),
- (0, r"\$\(foo\).*\$\(foo\) ", "preferences prompt >"),
+ (0, r"\$\(foo\).*\$\(foo\) ", "preferences prompt $(time)>"),
+ (0, "[0-9]> ", "preferences prompt >"),
(2, "> ", "preferences loglevel 0"),
(2, "> ", "preferences"),
(2, r"loglevel \x1b\[32m0\x1b\[0m.*> ", "preferences loglevel zero"),
parameter is supplied, the first must be the name of a preference and the
remainder is the value to which you wish to change it.
Examples:$(eol)$(eol) preferences$(eol) preferences
- prompt$(eol) preferences prompt $
+ prompt$(eol) preferences prompt $_(time)>
command.quit.action: mudpy.command.quit(actor)
command.quit.description: Leave the World.