def get_menu_choices(user):
"""Return a dict of choice:meaning."""
- menu = universe.groups["menu"][user.state]
- create_choices = menu.get("create")
+ state = universe.groups["menu"][user.state]
+ create_choices = state.get("create")
if create_choices:
choices = eval(create_choices)
else:
ignores = []
options = {}
creates = {}
- for facet in menu.facets():
+ for facet in state.facets():
if facet.startswith("demand_") and not eval(
universe.groups["menu"][user.state].get(facet)
):
options[facet] = facet.split("_", 2)[1]
for facet in creates.keys():
if not creates[facet] in ignores:
- choices[creates[facet]] = eval(menu.get(facet))
+ choices[creates[facet]] = eval(state.get(facet))
for facet in options.keys():
if not options[facet] in ignores:
- choices[options[facet]] = menu.get(facet)
+ choices[options[facet]] = state.get(facet)
return choices