Menu system flow amended, added shebang, linting/formatting #58

Manually merged
cmccabe merged 1 commits from menu-reflow into master 2019-12-10 16:28:28 +00:00
Collaborator

Fixes #57

Menus are set up as functions that do the following in a while loop:

  1. Process/print data
  2. Prompt for user input
  3. Handle input by calling the appropriate function

There are now three levels of menus:

  1. menu_view_categories()
  2. menu_view_category_details()
  3. menu_view_thread_details()

All functions* that are called from menus, including the lower-level menus, return to the caller when complete. When returning to a caller menu, the while loop continues - process/print data, prompt for input, handle input.

This should result in a uniform experience from menus and called functions.

One drawback to this approach is that it's not possible (yet?) to jump from a lower level menu to the top level menu.

Please check it out and let me know what you think!

A couple of other items:

  • There's a lot of rearrangement, reformatting and linting done too. These can be easily reverted if not to anyone's liking.
  • Also, to troubleshoot an issue with linting, I added shebangs to all modules that I missed earlier.
  • No tests yet. The functions weren't really rewritten, just split up a bit.
  • I accidental committed this directly to master, but reverted this. Let me know if you see any issues from this.

*graceful_exit() can be called from the menus, which does not return but instead exits.

Fixes #57 Menus are set up as functions that do the following in a `while` loop: 1. Process/print data 2. Prompt for user input 3. Handle input by calling the appropriate function There are now three levels of menus: 1. `menu_view_categories()` 2. `menu_view_category_details()` 3. `menu_view_thread_details()` All functions* that are called from menus, including the lower-level menus, return to the caller when complete. When returning to a caller menu, the `while` loop continues - process/print data, prompt for input, handle input. This should result in a uniform experience from menus and called functions. One drawback to this approach is that it's not possible (yet?) to jump from a lower level menu to the top level menu. Please check it out and let me know what you think! A couple of other items: - There's a lot of rearrangement, reformatting and linting done too. These can be easily reverted if not to anyone's liking. - Also, to troubleshoot an issue with linting, I added shebangs to all modules that I missed earlier. - No tests yet. The functions weren't really rewritten, just split up a bit. - I accidental committed this directly to master, but reverted this. Let me know if you see any issues from this. *`graceful_exit()` can be called from the menus, which does not return but instead exits.
asdf added the
bug
enhancement
this release
labels 2019-12-10 10:02:34 +00:00
cmccabe closed this pull request 2019-12-10 16:28:28 +00:00
asdf deleted branch menu-reflow 2019-12-10 19:50:53 +00:00
Sign in to join this conversation.
No description provided.