5 def __init__(self
, start_mark
=None, end_mark
=None):
6 self
.start_mark
= start_mark
7 self
.end_mark
= end_mark
9 attributes
= [key
for key
in ['anchor', 'tag', 'implicit', 'value']
10 if hasattr(self
, key
)]
11 arguments
= ', '.join(['%s=%r' % (key
, getattr(self
, key
))
12 for key
in attributes
])
13 return '%s(%s)' % (self
.__class
__.__name
__, arguments
)
15 class NodeEvent(Event
):
16 def __init__(self
, anchor
, start_mark
=None, end_mark
=None):
18 self
.start_mark
= start_mark
19 self
.end_mark
= end_mark
21 class CollectionStartEvent(NodeEvent
):
22 def __init__(self
, anchor
, tag
, implicit
, start_mark
=None, end_mark
=None,
26 self
.implicit
= implicit
27 self
.start_mark
= start_mark
28 self
.end_mark
= end_mark
29 self
.flow_style
= flow_style
31 class CollectionEndEvent(Event
):
36 class StreamStartEvent(Event
):
37 def __init__(self
, start_mark
=None, end_mark
=None, encoding
=None):
38 self
.start_mark
= start_mark
39 self
.end_mark
= end_mark
40 self
.encoding
= encoding
42 class StreamEndEvent(Event
):
45 class DocumentStartEvent(Event
):
46 def __init__(self
, start_mark
=None, end_mark
=None,
47 explicit
=None, version
=None, tags
=None):
48 self
.start_mark
= start_mark
49 self
.end_mark
= end_mark
50 self
.explicit
= explicit
51 self
.version
= version
54 class DocumentEndEvent(Event
):
55 def __init__(self
, start_mark
=None, end_mark
=None,
57 self
.start_mark
= start_mark
58 self
.end_mark
= end_mark
59 self
.explicit
= explicit
61 class AliasEvent(NodeEvent
):
64 class ScalarEvent(NodeEvent
):
65 def __init__(self
, anchor
, tag
, implicit
, value
,
66 start_mark
=None, end_mark
=None, style
=None):
69 self
.implicit
= implicit
71 self
.start_mark
= start_mark
72 self
.end_mark
= end_mark
75 class SequenceStartEvent(CollectionStartEvent
):
78 class SequenceEndEvent(CollectionEndEvent
):
81 class MappingStartEvent(CollectionStartEvent
):
84 class MappingEndEvent(CollectionEndEvent
):