Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using local config file with CLI mode #368

Open
yagui opened this issue Mar 31, 2023 · 7 comments
Open

Using local config file with CLI mode #368

yagui opened this issue Mar 31, 2023 · 7 comments

Comments

@yagui
Copy link

yagui commented Mar 31, 2023

I'm running the script from command line and I set the environment variable INTERACTIVE_HTML_BOM_NO_DISPLAY.
This works ok, but even though the ibom.config.ini file is present and also the general config.ini file is located at the InteractiveHtmlBom folder, neither of those is read in this NO_DISPLAY mode.
I there a way to force it to use either one of the config files?

I'm using latest (at the moment) commit 1b551f5 and KiCad 7.0.1

Thanks

@qu1ck
Copy link
Member

qu1ck commented Mar 31, 2023

No, currently in cli mode config files are not read, only flags you pass on command line matter.

wxWidgets has (or had) a bug where config reader does not work properly if gui is not initialized. I would probably need a hand-written parser to make config files work in cli mode.

@Funkenjaeger
Copy link
Contributor

I will just add that this is something that would also benefit the Fusion/Eagle workflow, for which I've only ever used the CLI mode. For instance, I understand why 'include tracks' and 'include nets' are disabled in ibom by default, but for my personal use I always want them enabled and I'd like to be able to flip that switch in the config file and never need to pass the extra command-line arguments again. Ditto for things like certain extra fields that I might want to always include.

I'm willing to help implement it, I just hadn't touched it before because the most obvious implementation would apply to all parsers, not just the Eagle/Fusion ones, and I was concerned about unintended side effects since I'm not at all experienced with kicad workflow(s).

@yagui
Copy link
Author

yagui commented Mar 31, 2023

I there an example on how to pass those flags through the command line? I couldn't find them.

I was thinking to force a simple parser if the option of no display is detected in the environment variables. I'll try to add it and if it works I'll submit a pull request.

@set-soft
Copy link
Contributor

My 2 cents:
@qu1ck why not using other mechanism for the config file?
For the rest: I think the points here is that people using the command line can easily write a script with the options, so you don't really need a config file. People using the GUI really needs it.

@qu1ck
Copy link
Member

qu1ck commented Mar 31, 2023

If anyone wants to take a stab at it, be my guest. Only requirement is to not use any packages outside of standard python installation and to test your code at least on windows and linux. I can help test on windows if you can't.

I there an example on how to pass those flags through the command line? I couldn't find them.

Launch the script with --help flag. Or read wiki usage page.

why not using other mechanism for the config file?

wxWidgets config lib was convenient and there wasn't a good reason to switch. Like you said, for cli it's easy to write a wrapper script to set all the flags you want.

@brockn8r
Copy link

qu1ck, I do have a good starting point for this, and I have created a patch if you are interested. I could create a branch and push, but I have not done any thorough testing. It works ok for what we need.

@qu1ck
Copy link
Member

qu1ck commented Nov 10, 2023

You can open a draft pull request, I can at least leave some comments on whether you are going in a direction that can be merged and what work needs to be done, if any, for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants