Source

pyyaml / lib / yaml / events.py

Kirill Simonov ea86bf3 

Kirill Simonov ed172c1 

Kirill Simonov ea86bf3 
Kirill Simonov 7c78def 

Kirill Simonov ed172c1 
Kirill Simonov ea86bf3 

Kirill Simonov ed172c1 




Kirill Simonov ea86bf3 
Kirill Simonov ed172c1 
Kirill Simonov 7c78def 

Kirill Simonov ed172c1 
Kirill Simonov ea86bf3 















Kirill Simonov 9c821c5 

Kirill Simonov ea86bf3 


Kirill Simonov 9c821c5 
Kirill Simonov ea86bf3 






















Kirill Simonov ed172c1 



Kirill Simonov ea86bf3 

Kirill Simonov ed172c1 


Kirill Simonov 7c78def 

Kirill Simonov ea86bf3 

Kirill Simonov ed172c1 
Kirill Simonov ea86bf3 
Kirill Simonov ed172c1 

Kirill Simonov ea86bf3 
Kirill Simonov ed172c1 

Kirill Simonov ea86bf3 
Kirill Simonov ed172c1 

Kirill Simonov ea86bf3 
Kirill Simonov a4348b1 

# Abstract classes.

class Event:
    def __init__(self, start_mark=None, end_mark=None):
        self.start_mark = start_mark
        self.end_mark = end_mark
    def __repr__(self):
        attributes = [key for key in ['anchor', 'tag', 'value']
                if hasattr(self, key)]
        arguments = ', '.join(['%s=%r' % (key, getattr(self, key))
                for key in attributes])
        return '%s(%s)' % (self.__class__.__name__, arguments)

class NodeEvent(Event):
    def __init__(self, anchor, start_mark=None, end_mark=None):
        self.anchor = anchor
        self.start_mark = start_mark
        self.end_mark = end_mark

class CollectionStartEvent(NodeEvent):
    def __init__(self, anchor, tag, start_mark=None, end_mark=None,
            flow_style=None):
        self.anchor = anchor
        self.tag = tag
        self.start_mark = start_mark
        self.end_mark = end_mark
        self.flow_style = flow_style

class CollectionEndEvent(Event):
    pass

# Implementations.

class StreamStartEvent(Event):
    def __init__(self, start_mark=None, end_mark=None,
            encoding=None, line_break=None, canonical=None,
            indent=None, width=None):
        self.start_mark = start_mark
        self.end_mark = end_mark
        self.encoding = encoding
        self.line_break = line_break
        self.canonical = canonical
        self.indent = indent
        self.width = width

class StreamEndEvent(Event):
    pass

class DocumentStartEvent(Event):
    def __init__(self, start_mark=None, end_mark=None,
            implicit=None, version=None, tags=None):
        self.start_mark = start_mark
        self.end_mark = end_mark
        self.implicit = implicit
        self.version = version
        self.tags = tags

class DocumentEndEvent(Event):
    def __init__(self, start_mark=None, end_mark=None,
            implicit=None):
        self.start_mark = start_mark
        self.end_mark = end_mark
        self.implicit = implicit

class AliasEvent(NodeEvent):
    pass

class ScalarEvent(NodeEvent):
    def __init__(self, anchor, tag, value, start_mark=None, end_mark=None,
            implicit=None, style=None):
        self.anchor = anchor
        self.tag = tag
        self.value = value
        self.start_mark = start_mark
        self.end_mark = end_mark
        self.implicit = implicit
        self.style = style

class SequenceStartEvent(CollectionStartEvent):
    pass

class SequenceEndEvent(CollectionEndEvent):
    pass

class MappingStartEvent(CollectionStartEvent):
    pass

class MappingEndEvent(CollectionEndEvent):
    pass