+ def prompt(self):
+ """"Generate and return an input prompt."""
+
+ # Start with the user's preference, if one was provided
+ prompt = self.account.get("prompt")
+
+ # If the user has not set a prompt, then immediately return the default
+ # provided for the current state
+ 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 prompt
+