InteractiveHtmlBom icon indicating copy to clipboard operation
InteractiveHtmlBom copied to clipboard

Add capability for ini file usage from the command line

Open brockn8r opened this issue 1 year ago • 4 comments

A couple notes:

  1. You will notice that I assumed the path to the config file was at the location from which generate_interactive_bom.py is called.
  2. 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.
  3. 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.

brockn8r avatar Nov 10 '23 16:11 brockn8r

Looks good, 2 general comments:

  1. You need to initialize the parser with defaults from class variables. You can not assume that ini files will have all values.
  2. 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).

qu1ck avatar Nov 10 '23 17:11 qu1ck

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...

Funkenjaeger avatar Dec 01 '23 01:12 Funkenjaeger

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 avatar Jan 19 '24 18:01 amauragis

@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.

Funkenjaeger avatar Jan 19 '24 20:01 Funkenjaeger