<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 02/02/17 03:16, Stuart Bishop wrote:<br>
</div>
<blockquote
cite="mid:CADmi=6P42a1N_BYacXWA0BzseB_NJwU6q7Yz=Psv-c+gbJoxAQ@mail.gmail.com"
type="cite">
<div dir="ltr"><br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 1 February 2017 at 21:48, Michael
Hall <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:mhall119@ubuntu.com" target="_blank">mhall119@ubuntu.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">On a
related note, does anybody have a suggestion on a
lightweight way<br>
of programmatically modifying configs in .ini, XML or
JSON?<br>
<br>
I have a couple of use-cases (erlang-based nosql
databases) where the<br>
server updates the the local configuration, so I can't
just overwrite<br>
the whole thing every time. Didier's example will work for
a very basic<br>
key=value config file, but not something more structured,
and I'd hate<br>
to introduce Python, Perl or Java just for this.<br>
</blockquote>
<div><br>
</div>
<div>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.</div>
</div>
<br clear="all">
<div>(but look at 'jq' if you insist on shell scripts - it
seemed very helpful for dealing with json)</div>
</div>
</div>
</blockquote>
<br>
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.<br>
<br>
Mark<br>
</body>
</html>