-
Notifications
You must be signed in to change notification settings - Fork 219
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
Change read_ini.sh to use associative arrays. #253
base: develop
Are you sure you want to change the base?
Conversation
Thanks for doing this. My only concern is that we are about to release v0.6 and I really don't want to get a bug in such a fundamental piece of Muiscbox. |
Well, I should rephrase, "another, different bug" |
Yes I think we should hold off incorporating this in the v0.6 release to see if we can find a permanent solution. At this stage my take on this is that:
Perhaps we can circle back to this after 0.6 has been released? |
We should be able to align the behaviour of the script with Python's It looks like this will be something like |
Ok then that's great you agree. It's a real shame as the bug it's fixing I like your idea to leverage Rawconfigparser. I was considering hacking up
|
I've revamped the script to behave more like Python's Please take a look at this fork to the bash_ini_parser project. I'm not sure if it will be merged there as it changes quite a few aspects of the original implementation. The script can be tested by running I suggest that we work on it there until we are happy and then we can merge it back into Pi MusicBox when all requirements have been satisfied? |
@kingosticks, now that 0.6 is out of the way do you think we can take another look at changing this ini file parser script? I've re-based on the current 'develop' branch so should be ready for merging - would you be willing to give it a go? |
Hi, sorry for the delay in getting back to you. Yes indeed, let me try out a couple of tests tonight/tomorrow and get this in. |
So the parsing looks fine but the problems are in startup.sh where the quotes around the keys are messing up the quoted string output e.g. There are a few similar cases throughout the script and one in setsound.sh too. Can we use single quotes? Or move it into a temporary variable and then use that in the quoted output? |
Thank you for the feedback. Could you elaborate a little on the problem that you are encountering please? My scripting skills aren't that great, but I get the output of the above as |
Yeh... I'm not sure how I managed to convince myself that was a problem as it seems to work just fine. I'll resurrect my test files and try and see what I did wrong. In other news, I came across this neat solution using python which is bit annoying as I it's so much simpler. |
Using the built-in Python parser will be much better as it is one less thing that we need to maintain. Are you going to take a shot at integrating? |
I think it makes sense to do so. I'm sorry that it means we don't need your
|
Allows special characters to be used in section names of settings.ini.
Adds support for configuring extensions like [local-sqlite] properly.
Note that support for the search_limit parameter requires Mopidy-Local-SQLite >= 0.9.2 (run pip install --upgrade Mopidy-Local-SQLite to upgrade)
This is a rebase of #234 on to /upstream/develop.