1 |
Attached is an overhaul of John's code. Aside from some bugfixes and |
2 |
readability improvements, the most significant changes are: |
3 |
|
4 |
- Renamed functions to follow de facto and emerging Portage API naming |
5 |
conventions. |
6 |
|
7 |
- Validation of input for the list prompt and confirmation prompt functions. |
8 |
|
9 |
- Added more terminal color codes, based on the codes from Portage's |
10 |
output.py module. |
11 |
|
12 |
- Improved handling when Portage's NOCOLOR environment var is set. |
13 |
|
14 |
I've left some test code at the end to make it easy for everyone (and |
15 |
I do mean everyone; this sucker needs a lot of testing) to try out the |
16 |
various interactive prompts this eclass provides -- just run the |
17 |
eclass directly and have fun. You can also run it in no color mode |
18 |
thusly: |
19 |
|
20 |
# NOCOLOR=true ./einput.eclass |
21 |
|
22 |
If your system is already set to no color by default, you should be |
23 |
able to turn on color like so: |
24 |
|
25 |
# NOCOLOR= ./einput.eclass |