Alright, here is a patch to implement this:<br><br><br>diff --git a/lenses/inifile.aug b/lenses/inifile.aug<br>index aadb3c3..cda79b6 100644<br>--- a/lenses/inifile.aug<br>+++ b/lenses/inifile.aug<br>@@ -79,11 +79,20 @@ Variable: sto_to_eol<br>
 let sto_to_eol         = Sep.opt_space . store Rx.space_in<br><br> (*<br>+Variable: to_comment_re<br>+  Regex until comment<br>+*)<br>+let to_comment_re = /[^;# \t\n][^;#\n]*[^;# \t\n]|[^;# \t\n]/<br>+<br>+(*<br> Variable: sto_to_comment<br>
   Store until comment<br> *)<br>-let sto_to_comment     = Sep.opt_space<br>-                         . store /[^;# \t\n][^;#\n]*[^;# \t\n]|[^;# \t\n]/<br>+let sto_to_comment = Sep.opt_space . store to_comment_re<br>+<br>
+let sto_multiline = Sep.opt_space<br>+         . store (to_comment_re<br>+               . (/[ \t]*\n/ . Rx.space . to_comment_re)*)<br><br><br> (* Group: Define comment and defaults *)<br>@@ -140,6 +149,11 @@ View: entry<br>
 let entry (kw:regexp) (sep:lens) (comment:lens)<br>                        = [ key kw . sep . sto_to_comment? . (comment|eol) ] | comment<br><br>+<br>+let entry_multiline (kw:regexp) (sep:lens) (comment:lens)<br>+                       = [ key kw . sep . sto_multiline? . (comment|eol) ] | comment<br>
+<br>+<br> (*<br> View: indented_entry<br>   Generic INI File entry that might be indented with an arbitrary<br>diff --git a/lenses/tests/test_inifile.aug b/lenses/tests/test_inifile.aug<br>index 6155e30..a87b504 100644<br>
--- a/lenses/tests/test_inifile.aug<br>+++ b/lenses/tests/test_inifile.aug<br>@@ -203,4 +203,12 @@ test_bdf =<br>          { "test_bdf" } }<br><br><br>+  (* TEST multiline values *)<br>+  let multiline_test = "test_ace = val1\n  val2\n   val3\n"<br>
+  let multiline_ace = IniFile.entry_multiline IniFile.entry_re sep_ace comment_ace<br>+  test multiline_ace get multiline_test =<br>+      { "test_ace" = "val1\n  val2\n   val3" }<br>+<br>+<br>+<br><br>
<br><br>Let me know if that fits your need.<br><br><br>Raphaël<br><br><br><br><div class="gmail_quote">2011/6/8 Kent Tenney <span dir="ltr"><<a href="mailto:ktenney@gmail.com">ktenney@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
A quick test of a buildout shows that a multiline value<br>
becomes a string with embedded newlines, and degree<br>
of indentation doesn't matter:<br>
<br>
[buildout]<br>
parts =<br>
 a<br>
  b<br>
   c<br>
<br>
results in<br>
... 'parts': '\na\nb\nc'<br>
<br>
Thanks,<br>
Kent<br>
<br>
2011/6/8 Raphaël Pinson <<a href="mailto:raphink@gmail.com">raphink@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Hi Kent,<br>
><br>
> On Tue, Jun 7, 2011 at 9:58 PM, Kent Tenney <<a href="mailto:ktenney@gmail.com">ktenney@gmail.com</a>> wrote:<br>
>><br>
>> Howdy,<br>
>><br>
>> from inifile.aug<br>
>><br>
>> "About: TODO<br>
>>  Things to add in the future<br>
>>  - Support double quotes in value<br>
>>  - Support multiline values (is it standard?)"<br>
>><br>
>> I don't know if multiline values are standard or not,<br>
>> but they are part of the Python configparser dialect of ini.<br>
>> <a href="http://docs.python.org/library/configparser.html" target="_blank">http://docs.python.org/library/configparser.html</a><br>
>><br>
>> zc.buildout is a very widely used tool for managing<br>
>> Python software installations, it is based on ini files<br>
>> with multiline values. It would be great if Augeas<br>
>> understood them. If I could provide a patch I would ...<br>
>><br>
><br>
> The hard part about multiline values in IniFile is their format: indented<br>
> values with a constant indentation level.<br>
> I've scratched my head in the past to see how Augeas could parser and<br>
> represent that.<br>
> The first part is how to represent them. Should multiline values be stored<br>
> in one node with "\n" characters (and indentations), or should they be split<br>
> into several nodes?<br>
> The second question is how to modify a multiline value, namely how do we<br>
> keep the same indentation level for new lines in Augeas, since Augeas cannot<br>
> remember (afaik) the indentation level of previous lines?<br>
><br>
> Maybe David would have a clue on this.<br>
><br>
> Regards<br>
> Raphaël<br>
</div></div></blockquote></div><br>