+ # if the user's client echo is off, send a blank line for aesthetics
+ if not user.echoing: user.send("", "")
+
+def generic_menu_handler(user):
+ """A generic menu choice handler."""
+
+ # get a lower-case representation of the next line of input
+ choice = user.input_queue.pop(0)
+ if choice: choice = choice.lower()
+
+ # run any script related to this choice
+ exec(muffmenu.get_choice_action(user, choice))
+
+ # move on to the next state or return an error
+ new_state = muffmenu.get_choice_branch(user, choice)
+ if new_state: user.state = new_state
+ else: user.error = "default"
+