Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
events.py
Go to the documentation of this file.
1 # (c) Copyright Rosetta Commons Member Institutions.
2 # (c) This file is part of the Rosetta software suite and is made available under license.
3 # (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
4 # (c) For more information, see http://www.rosettacommons.org. Questions about this can be
5 # (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
6 
7 # Abstract classes.
8 
9 class Event(object):
10  def __init__(self, start_mark=None, end_mark=None):
11  self.start_mark = start_mark
12  self.end_mark = end_mark
13  def __repr__(self):
14  attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
15  if hasattr(self, key)]
16  arguments = ', '.join(['%s=%r' % (key, getattr(self, key))
17  for key in attributes])
18  return '%s(%s)' % (self.__class__.__name__, arguments)
19 
21  def __init__(self, anchor, start_mark=None, end_mark=None):
22  self.anchor = anchor
23  self.start_mark = start_mark
24  self.end_mark = end_mark
25 
27  def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,
28  flow_style=None):
29  self.anchor = anchor
30  self.tag = tag
31  self.implicit = implicit
32  self.start_mark = start_mark
33  self.end_mark = end_mark
34  self.flow_style = flow_style
35 
37  pass
38 
39 # Implementations.
40 
41 class StreamStartEvent(Event):
42  def __init__(self, start_mark=None, end_mark=None, encoding=None):
43  self.start_mark = start_mark
44  self.end_mark = end_mark
45  self.encoding = encoding
46 
48  pass
49 
50 class DocumentStartEvent(Event):
51  def __init__(self, start_mark=None, end_mark=None,
52  explicit=None, version=None, tags=None):
53  self.start_mark = start_mark
54  self.end_mark = end_mark
55  self.explicit = explicit
56  self.version = version
57  self.tags = tags
58 
60  def __init__(self, start_mark=None, end_mark=None,
61  explicit=None):
62  self.start_mark = start_mark
63  self.end_mark = end_mark
64  self.explicit = explicit
65 
67  pass
68 
69 class ScalarEvent(NodeEvent):
70  def __init__(self, anchor, tag, implicit, value,
71  start_mark=None, end_mark=None, style=None):
72  self.anchor = anchor
73  self.tag = tag
74  self.implicit = implicit
75  self.value = value
76  self.start_mark = start_mark
77  self.end_mark = end_mark
78  self.style = style
79 
81  pass
82 
84  pass
85 
87  pass
88 
90  pass
91