Revision 4af458e3 lib/utils/text.py
b/lib/utils/text.py | ||
---|---|---|
245 | 245 |
""" |
246 | 246 |
INDENT_STR = " " |
247 | 247 |
|
248 |
def __init__(self, fh): |
|
248 |
def __init__(self, fh, indent=True):
|
|
249 | 249 |
"""Initializes this class. |
250 | 250 |
|
251 | 251 |
""" |
252 | 252 |
self._fh = fh |
253 |
self._indent_enabled = indent |
|
253 | 254 |
self._indent = 0 |
254 | 255 |
|
255 | 256 |
def IncIndent(self): |
... | ... | |
276 | 277 |
else: |
277 | 278 |
line = txt |
278 | 279 |
|
279 |
if line: |
|
280 |
if line and self._indent_enabled:
|
|
280 | 281 |
# Indent only if there's something on the line |
281 | 282 |
self._fh.write(self._indent * self.INDENT_STR) |
282 | 283 |
|
Also available in: Unified diff