Move the action logic for the checking_new_account_name state from
its respective facets to the menu module, hiding them behind
consistently-named entry points.
"""List available avatars as choices for the activate_avatar state."""
return dict(
[(str(x + 1), y) for x, y in enumerate(user.list_avatar_names())])
+
+
+def checking_new_account_name_action_d(user):
+ """Destroy the new account because the user asked to disconnect."""
+ return user.account.destroy()
+
+
+def checking_new_account_name_action_g(user):
+ """Destroy the new account, the user asked to go back to name entry."""
+ return user.account.destroy()
menu.active.prompt: ">"
-menu.checking_new_account_name.action_d: user.account.destroy()
-menu.checking_new_account_name.action_g: user.account.destroy()
+menu.checking_new_account_name.action_d:
+ mudpy.menu.checking_new_account_name_action_d(user)
+menu.checking_new_account_name.action_g:
+ mudpy.menu.checking_new_account_name_action_g(user)
menu.checking_new_account_name.branch_d: disconnecting
menu.checking_new_account_name.branch_g: entering_account_name
menu.checking_new_account_name.branch_n: entering_new_password