summaryrefslogtreecommitdiff
path: root/emitter.py
diff options
context:
space:
mode:
Diffstat (limited to 'emitter.py')
-rw-r--r--emitter.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/emitter.py b/emitter.py
index d8ccb25..b24bea2 100644
--- a/emitter.py
+++ b/emitter.py
@@ -257,7 +257,7 @@ class Emitter(object):
def expect_node(self, root=False, sequence=False, mapping=False,
simple_key=False):
self.root_context = root
- self.sequence_context = sequence
+ self.sequence_context = sequence # not used in PyYAML
self.mapping_context = mapping
self.simple_key_context = simple_key
if isinstance(self.event, AliasEvent):
@@ -583,6 +583,8 @@ class Emitter(object):
# if self.analysis.multiline and split \
# and (not self.style or self.style in '\'\"'):
# self.write_indent()
+ if self.sequence_context and not self.flow_level:
+ self.write_indent()
if self.style == '"':
self.write_double_quoted(self.analysis.scalar, split)
elif self.style == '\'':
@@ -1204,7 +1206,6 @@ class Emitter(object):
def write_comment(self, comment):
value = comment.value
- print('################## comment', repr(value))
# print('{:02d} {:02d} {}'.format(self.column, comment.start_mark.column, value))
if value[-1] == '\n':
value = value[:-1]