[augeas-devel] Help for INI file variation

Raphaël Pinson raphael.pinson at camptocamp.com
Sat Feb 22 08:44:31 UTC 2014


Hello Marco,

1) is just a setting, like:

    let comment = IniFile.comment ";" ";"

2) shouldn't be a limitation at all.

For 3), have a look at the PythonPaste module, which also allows for "#" in
values:

https://github.com/hercules-team/augeas/blob/master/lenses/pythonpaste.aug


For 4), have a look at the Quote module (used in various lenses), which
allows to manage quotes automatically (double, single or both). The doc is
at http://augeas.net/docs/references/lenses/files/quote-aug.html. See also
the examples (unit tests) at
http://augeas.net/docs/references/lenses/files/tests/test_quote-aug.html


Cheers,

Raphaël



On Sat, Feb 22, 2014 at 1:35 AM, Zero Uno <zerozerounouno at gmail.com> wrote:

> Hi,
> I'm trying to create a slightly modified lens for INI-like files
> having the following features:
>
> 1. comments only start with semicolons ";"
> 2. parameter keywords con contain "@"
> 3. parameter values can contain "#"
> 4. ideally, parameter values should be able to contain double quotes,
> but maybe this is currently not possible
>
> I duplicated puppet.aug and started from there, but I'm still missing
> something: requirement n. 2 seems to be satisfied,  but I cannot
> satisfy n. 3, augeas returns a parse error when it encounters a
> parameter value containing a "#".
>
> I don't have my edited file at hand now, but anyway I redefined
> comment_re and to_comment_re by removing "#" from the regex.
> I've been looking at the file and AFAICT it's ok, I cannot understand
> why augeas still cannot parse the configuration files.
>
> Any suggestions?
> Thanks.
> Marco
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel
>



-- 
Raphaël Pinson
Infrastructure Developer & Trainer
+33 479 26 57 93
+33 781 90 00 79

Camptocamp France
Savoie Technolac
BP 352
48, avenue du Lac du Bourget
73372 Le Bourget du Lac, Cedex
www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20140222/116a032a/attachment.htm>


More information about the augeas-devel mailing list