plugins.py 673 B

12345678910111213141516171819202122
  1. from itertools import chain
  2. from pluggy import HookimplMarker
  3. impl = HookimplMarker('flaskbb')
  4. @impl(hookwrapper=True, tryfirst=True)
  5. def flaskbb_tpl_profile_settings_menu():
  6. """
  7. Flattens the lists that come back from the hook
  8. into a single iterable that can be used to populate
  9. the menu
  10. """
  11. results = [
  12. (None, 'Account Settings'),
  13. ('user.settings', 'General Settings'),
  14. ('user.change_user_details', 'Change User Details'),
  15. ('user.change_email', 'Change E-Mail Address'),
  16. ('user.change_password', 'Change Password')
  17. ]
  18. outcome = yield
  19. outcome.force_result(chain(results, *outcome.get_result()))