Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
nodes.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 class Node(object):
8  def __init__(self, tag, value, start_mark, end_mark):
9  self.tag = tag
10  self.value = value
11  self.start_mark = start_mark
12  self.end_mark = end_mark
13  def __repr__(self):
14  value = self.value
15  #if isinstance(value, list):
16  # if len(value) == 0:
17  # value = '<empty>'
18  # elif len(value) == 1:
19  # value = '<1 item>'
20  # else:
21  # value = '<%d items>' % len(value)
22  #else:
23  # if len(value) > 75:
24  # value = repr(value[:70]+u' ... ')
25  # else:
26  # value = repr(value)
27  value = repr(value)
28  return '%s(tag=%r, value=%s)' % (self.__class__.__name__, self.tag, value)
29 
31  id = 'scalar'
32  def __init__(self, tag, value,
33  start_mark=None, end_mark=None, style=None):
34  self.tag = tag
35  self.value = value
36  self.start_mark = start_mark
37  self.end_mark = end_mark
38  self.style = style
39 
41  def __init__(self, tag, value,
42  start_mark=None, end_mark=None, flow_style=None):
43  self.tag = tag
44  self.value = value
45  self.start_mark = start_mark
46  self.end_mark = end_mark
47  self.flow_style = flow_style
48 
50  id = 'sequence'
51 
53  id = 'mapping'
54 
def __repr__
Definition: nodes.py:13
def __init__
Definition: nodes.py:8