InteractiveHtmlBom
InteractiveHtmlBom copied to clipboard
Add capability for ini file usage from the command line
A couple notes:
- You will notice that I assumed the path to the config file was at the location from which generate_interactive_bom.py is called.
- I commented out args bom_dest_dir and open_browser because I didn't want any opportunity for error by others forgetting to set those parameters in the ini file.
- This mod should address issue #368
This works mostly for us. We run on Linux (Fedora). I say mostly because there are still some oddities. For example, other than bom_dest_dir and open_browser, I still pass another option (--extra-data-file) on the command line even though I am using the ini file because I haven't figured out why it wasn't working.
Looks good, 2 general comments:
- You need to initialize the parser with defaults from class variables. You can not assume that ini files will have all values.
- Use appropriate getters (
getbool
,getint
)
You will notice that I assumed the path to the config file was at the location from which generate_interactive_bom.py is called.
Actually you are checking locations where the board file is or where the plugin is. Which is correct.
I commented out args bom_dest_dir and open_browser because I didn't want any opportunity for error by others forgetting to set those parameters in the ini file.
That's why you need to use defaults.
I still pass another option (--extra-data-file)
It is intentionally not saved to the ini file because it is supposed to be dynamically chosen (unless explicitly specified by user).
I took a stab at addressing the two things @qu1ck pointed out in 49b31b2f8796d1e00a500b6f2c2d19c44be3d04e I didn't create my own PR, assuming that @brockn8r will be back and can leverage my commit to finish this one.
I only did the most cursory testing, so I wouldn't yet assume it's bug-free...
I think its unlikely that @brockn8r will be back to work on this (he is no longer in the role he was when creating it). If @Funkenjaeger wants to take ownership of the PR, great! Otherwise I'm happy to make a new one with those two commits....
@amauragis be my guest! I'm distracted with other projects lately, so it'd probably be a while yet until I focused on this enough to get it over the line.