feat: add options loading from .ini file#4
Conversation
|
About the new deps: I'm using the |
|
@markoxley, I saw you've tried something on this issue. Do you have any thoughts or suggestions too? ^^ |
It would be quite simple to adapt my code to handle multiple Vectors. https://github.com/markoxley/vutils If a new struct was added to store the configurations, then the regex would also need to be amended to something like: The loop will then need to be amended. I'm not at my development machine right now, but when I get a chance, I'll amend the utils module to handle multiple Vectors. |
Description
Create a loader that reuses the existing format from the python SDK.
It's loading the options from the
~/.anki_vector/sdk_config.inipath.To ensure it will work well for Linux, macOS, and Windows, the loader uses
os.UserHomeDir()to get the user home directory andfilepath.Jointo create a compatible file path.Linked Issues
Write a configuration loader that reuses the existing format from the python sdk #1
Notes
This code is not actually supporting 100% of the existing
.iniformat (for python SDK). It's only loading the information from theDEFAULTsection, and mapping to a struct, like:The code for getting the section is:
A suggestion to handle this is to add a "profile" that targets the wanted section, similar to AWS profiles in the CLI, and pass it as a parameter in
vector.New()or something like this. So we could do something like:And then it wil load the information about the another bot.
Additionally
What do you think about add logging to the SDK? There are some blank identifiers ("_") for errors that should not crash the function, but it might be a good idea to display them.
Thoughts? @dietb @bussardrobbie