def delete_account_action_y(user):
"""Permanently delete the account and all avatars, as requested."""
return user.destroy()
+
+
+def delete_avatar_action(user):
+ """Delete the selected avatar."""
+ return user.delete_avatar(
+ user.account.get("avatars")[int(user.choice) - 1])
+
+
+def delete_avatar_action_a(user):
+ """Abort avatar deletion."""
+ return True
+
+
+def delete_avatar_create(user):
+ """List available avatars for possible deletion."""
+ return dict(
+ [(str(x + 1), y) for x, y in enumerate(user.list_avatar_names())])
menu.delete_account.prompt: Are you certain you wish to permanently delete your
account?
-menu.delete_avatar.action: user.delete_avatar(
- user.account.get("avatars")[int(user.choice)-1])
-menu.delete_avatar.action_a: pass
+menu.delete_avatar.action: mudpy.menu.delete_avatar_action(user)
+menu.delete_avatar.action_a: mudpy.menu.delete_avatar_action_a(user)
menu.delete_avatar.branch: main_utility
menu.delete_avatar.branch_a: main_utility
menu.delete_avatar.choice_a: abort selection
-menu.delete_avatar.create: dict([(str(x+1),y) for x,y in
- enumerate(user.list_avatar_names())])
+menu.delete_avatar.create: mudpy.menu.delete_avatar_create(user)
menu.delete_avatar.default: a
menu.delete_avatar.description: This is the list of avatars available for you
to delete.