added '\n' indentation injection support

This commit is contained in:
Kenneth Reitz
2011-03-20 15:44:37 -04:00
parent ae955083e2
commit 2bae2fd223
+6
View File
@@ -57,6 +57,12 @@ class Writer(object):
def __call__(self, s, newline=True, stream=STDOUT):
if newline:
s = s.split('\n')
indent = ''.join(self.shared['indent_strings'])
s = (indent + '\n').join(s)
_str = ''.join((
''.join(self.shared['indent_strings']),
str(s),