[CMF-checkins] SVN: CMF/trunk/GenericSetup/utils.py - respect the
'indent' argument of toprettyxml() in all places
Yvo Schubbe
y.2005- at wcm-solutions.de
Thu Dec 15 06:04:26 EST 2005
Log message for revision 40788:
- respect the 'indent' argument of toprettyxml() in all places
Changed:
U CMF/trunk/GenericSetup/utils.py
-=-
Modified: CMF/trunk/GenericSetup/utils.py
===================================================================
--- CMF/trunk/GenericSetup/utils.py 2005-12-14 22:49:46 UTC (rev 40787)
+++ CMF/trunk/GenericSetup/utils.py 2005-12-15 11:04:26 UTC (rev 40788)
@@ -300,9 +300,10 @@
class _LineWrapper:
- def __init__(self, writer, indent, newl, max):
+ def __init__(self, writer, indent, addindent, newl, max):
self._writer = writer
self._indent = indent
+ self._addindent = addindent
self._newl = newl
self._max = max
self._length = 0
@@ -317,7 +318,8 @@
if 0 < self._length > self._max - len(self._queue):
self._writer.write(self._newl)
self._length = 0
- self._queue = '%s %s' % (self._indent, self._queue)
+ self._queue = '%s%s %s' % (self._indent, self._addindent,
+ self._queue)
if self._queue != self._indent:
self._writer.write(self._queue)
@@ -339,7 +341,7 @@
# indent = current indentation
# addindent = indentation to add to higher levels
# newl = newline string
- wrapper = _LineWrapper(writer, indent, newl, 78)
+ wrapper = _LineWrapper(writer, indent, addindent, newl, 78)
wrapper.write('<%s' % self.tagName)
# move 'name', 'meta_type' and 'title' to the top, sort the rest
@@ -371,7 +373,7 @@
if textlines:
for textline in textlines:
wrapper.write('', True)
- wrapper.queue(' %s' % textline)
+ wrapper.queue('%s%s' % (addindent, textline))
else:
wrapper.write('', True)
node.writexml(writer, indent+addindent, addindent, newl)
More information about the CMF-checkins
mailing list