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
config is built using ordered dict #1800
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1800 +/- ##
========================================
Coverage 81.81% 81.81%
========================================
Files 77 77
Lines 6323 6323
========================================
Hits 5173 5173
Misses 1150 1150
Continue to review full report at Codecov.
|
Could you give an example of why this is useful? |
Hello, |
By this, do you mean that the most 'important' options are ordered before the others e.g. enabled, username, passwords etc? |
yes, that's it ! it follows the order that was implemented in get_config_schema the front end can keep this order because of ordered dict |
We probably need to think again about an API for modifying the config. Exposing secret values to all extensions isn't very nice and nor is this kind of thing. However, for now I guess this is OK. And in python3 the dictionary will be ordered anyway. And FYI, in mopidy-websettings we found that you don't normally want to expose changing all the config since some of it is not interesting to most people. And in order to produce a sensible html form you need some knowledge of what type each config value is. So for both those reasons we ended up explicity defining what config to show and in what order, the types, and some simple validation rules. |
kingosticks, |
I reckon we can close it. |
Configuration is based on ordered dict, allowing apps to provide better settings UI and user experience (like web-settings or equivalent)