Closed da-raf closed 1 week ago
The changes primarily focus on the ovos_config/__main__.py
file, enhancing the set
command functionality in the configuration management tool. A new variable, absolute_path
, is introduced to identify if a key is an absolute path. The logic for retrieving configuration values is modified based on this variable, allowing for direct retrieval of values when the path is absolute and utilizing a different method for relative paths. Error handling has been improved to ensure graceful exits when no matches are found, while user prompts for multiple matches remain unchanged.
File | Change Summary |
---|---|
ovos_config/main.py | Enhanced set command functionality; introduced absolute_path variable; modified value retrieval logic based on path type; improved error handling for unmatched keys. |
sequenceDiagram
participant User
participant ConfigTool
participant Config
User->>ConfigTool: set(key, value)
ConfigTool->>Config: check if key is absolute_path
alt Absolute Path
ConfigTool->>Config: pathGet(CONFIG, key)
else Relative Path
ConfigTool->>Config: walkDict(CONFIG, key)
end
ConfigTool->>User: return value or error message
🐇 "In the world of config, we hop and we play,
With paths that are clear, we set them today!
Absolute or not, we know what to do,
With errors now handled, we bid them adieu.
So let’s configure, with joy in our hearts,
For every new change, a fresh start imparts!" 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
https://github.com/OpenVoiceOS/ovos-config/pull/182 contains a superset of functionality compared to this PR. If the other PR is intended to get merged, then this PR can get closed.
analogously to $ ovos-config get -k /location/city/name one can now set values with absolute key paths $ ovos-config set -k /location/city/name -v Mycity
addresses https://github.com/OpenVoiceOS/ovos-config/issues/180
Summary by CodeRabbit
New Features
set
command in the configuration management tool for improved handling of absolute paths.Bug Fixes