termenu
termenu copied to clipboard
Discussion PR - AppMenu + python3
Hi! I've added an 'App' layer on top of termenu that allows it to act as a pretty dynamic and rich terminal-based menu application. You can go in and out of sub-menus, preserving selections at each level, invoking actions on selected items, all in OOP/functional style. Admittedly, it is not as straightforward as I'd like it to be (to a some extent because of the reliance on Termenu's own plugins model, and trying to keep it decoupled from the App level), but it has enabled a great UX where I've implemented it. I've provided some examples of the feature-set (examples are somewhat awkward, hopefully the idea comes across).
I'm all open to the idea of detaching it from the Termenu core and developing separately with the due credits to its inspiration.
Oh, and there's also a bunch of python2/3 compatibility fixes with this.
How shit :) you've been working on this for a long time. It's going to take me a little while to go over the code and see what you've done there.
Meanwhile, do you mind splitting the Python3 changes into a separate pull request? That I could merge that easily. Hmm... taking a longer look, it seems you've changed things quite a bit for Python 3. I'm wondering if termenu should support Python 2, Python 3, or both. Not sure yet.
Also, it might make sense for the App project to be separate, but perhaps dependent on termenu. We could do the required changes in termenu core to support the plugin points you need.
Finally, I'm super excited you're still tinkering with this. Honestly I haven't looked at the termenu code for ages.
I've used it a lot at XIV, and I wanna use this now at Weka. Yes, indeed the python2/3 compatibility isn't trivial.
I feel AppMenu should be its own project - coupling it with termenu makes it prohibitively complex and harder to maintain. Maybe some pair-programming is in order...
What came out of your work in the end? Did you create a separate project?
Looking at some of the requirements you've implemented, it might be easier to do the kind of menu you were aiming at with curses, which is full screen by default and might be better suited for the task.
Something like this perhaps:
http://curses-menu.readthedocs.io/en/latest/