On 02/02/17 03:16, Stuart Bishop wrote: > > > On 1 February 2017 at 21:48, Michael Hall <mhall...@ubuntu.com > <mailto:mhall...@ubuntu.com>> wrote: > > On a related note, does anybody have a suggestion on a lightweight way > of programmatically modifying configs in .ini, XML or JSON? > > I have a couple of use-cases (erlang-based nosql databases) where the > server updates the the local configuration, so I can't just overwrite > the whole thing every time. Didier's example will work for a very > basic > key=value config file, but not something more structured, and I'd hate > to introduce Python, Perl or Java just for this. > > > Really? I thought Python was an excellent choice, and built and staged > all my wrappers as a Python part. 'core' already has Python3, so it > isn't bloating the snap size. And it makes it a doddle to manipulate > json, yaml or ini files, when this sort of thing requires an expert to > do correctly in bash or dash. > > (but look at 'jq' if you insist on shell scripts - it seemed very > helpful for dealing with json)
I would strongly +1 python3 from the core snap for general hook authorship. It's always there, it's perfectly fast for one-time operations, it's comfortable for text handling, it's architecture-independent with small files. Mark
-- Snapcraft mailing list Snapcraft@lists.snapcraft.io Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/snapcraft