|
From: Michael F. <fuz...@vo...> - 2006-07-17 23:18:31
|
Justus Pendleton wrote:
> [I found this thread in the archives...]
>
> Abhi initially said:
>
>>> I see in the documentation that the use of '\' as a continuation
>>> character for multi-line data is no longer supported in ConfigObj 4.
>>>
>
> To which Fuzzyman responded:
>
>> I'm afraid I don't like '\' as continuation syntax, and won't add it
>> back to ConfigObj.
>>
>> The correct way to create multiline values is with triple quote
>> strings
>>
>
> Except ConfigObj3 let you create a multi-line list like:
>
> foo = a, \
> b, \
> c
>
> But ConfigObj4 just turns the following into a big (and useless to me)
> string:
> foo = """a,
> b,
> c"""
>
What about preprocessing as I suggested ?
infile = open(filename).read().splitlines()
processedFile = []
x = 0
while x < len(infile):
line = infile[x]
x += 1
while line.endswith('\\'):
line = line[:-1]
x += 1
if x == len(infile):
break
line += infile[x]
processedFile.append(line)
Then pass processedFile to ConfigObj. Something like that anyway...
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Configobj-develop mailing list
> Con...@li...
> https://lists.sourceforge.net/lists/listinfo/configobj-develop
>
>
|