[Checkins] SVN: Sandbox/ulif/ZConfigParser/ZConfigParser/convert. Several subsections should form a .ini-like list.
Uli Fouquet
uli at gnufix.de
Tue Apr 7 06:33:04 EDT 2009
Log message for revision 98974:
Several subsections should form a .ini-like list.
Changed:
U Sandbox/ulif/ZConfigParser/ZConfigParser/convert.py
U Sandbox/ulif/ZConfigParser/ZConfigParser/convert.txt
-=-
Modified: Sandbox/ulif/ZConfigParser/ZConfigParser/convert.py
===================================================================
--- Sandbox/ulif/ZConfigParser/ZConfigParser/convert.py 2009-04-07 10:26:36 UTC (rev 98973)
+++ Sandbox/ulif/ZConfigParser/ZConfigParser/convert.py 2009-04-07 10:33:04 UTC (rev 98974)
@@ -53,13 +53,20 @@
# occur in the same section.
num = 0
child_name = child.nodeName
+ child_is_list_item = False
while child_name in references:
+ child_is_list_item = True
num += 1
child_name = '%s.%s' % (child.nodeName, num)
references.append(child_name)
child_prefix = '%s/%s' % (prefix, child_name)
- body += '%s = %s\n' % (child_name, child_prefix)
+ if not child_is_list_item:
+ body += '%s = %s\n' % (child_name, child_prefix)
+ else:
+ body += '%s%s\n' % (' '*(len(child.nodeName) + 3),
+ child_prefix)
+
subsections += "\n[%s]\n" % child_prefix
if child.hasAttributes() and 'name' in child.attributes.keys():
label = child.getAttribute('name').lower()
Modified: Sandbox/ulif/ZConfigParser/ZConfigParser/convert.txt
===================================================================
--- Sandbox/ulif/ZConfigParser/ZConfigParser/convert.txt 2009-04-07 10:26:36 UTC (rev 98973)
+++ Sandbox/ulif/ZConfigParser/ZConfigParser/convert.txt 2009-04-07 10:33:04 UTC (rev 98974)
@@ -166,7 +166,7 @@
<BLANKLINE>
[zope/accesslog]
logfile = zope/accesslog/logfile
- logfile.1 = zope/accesslog/logfile.1
+ zope/accesslog/logfile.1
<BLANKLINE>
[zope/accesslog/logfile]
path = %(LOGDIR)s/access.log
@@ -176,7 +176,7 @@
<BLANKLINE>
[zope/eventlog]
logfile = zope/eventlog/logfile
- logfile.1 = zope/eventlog/logfile.1
+ zope/eventlog/logfile.1
<BLANKLINE>
[zope/eventlog/logfile]
path = %(LOGDIR)s/z3.log
More information about the Checkins
mailing list