CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes | Static Private Member Functions | Private Attributes
XML2Python.TreeBuilder Class Reference
Inheritance diagram for XML2Python.TreeBuilder:

Public Member Functions

def __init__ (self, kwargs)
 
def __init__ (self, kwargs)
 
def characters (self, content)
 
def characters (self, content)
 
def endElement (self, name)
 
def endElement (self, name)
 
def root (self)
 
def root (self)
 
def startElement (self, name, attrs)
 
def startElement (self, name, attrs)
 
def topLevel (self)
 
def topLevel (self)
 

Public Attributes

 current
 

Static Public Attributes

 non_id_char
 

Static Private Member Functions

def _name_mangle (name)
 
def _name_mangle (name)
 

Private Attributes

 _ncDict
 
 _root
 
 _stack
 
 _text_parts
 

Detailed Description

Definition at line 161 of file XML2Python.py.

Constructor & Destructor Documentation

def XML2Python.TreeBuilder.__init__ (   self,
  kwargs 
)

Definition at line 165 of file XML2Python.py.

Referenced by XML2Python.TreeBuilder.__init__().

165  def __init__ (self, **kwargs):
166  self._stack = []
167  self._text_parts = []
168  self._ncDict = kwargs.get ('nameChangeDict', {})
169  self._root = DataNode (nameChangeDict = self._ncDict)
170  self.current = self._root
171 
def __init__(self, kwargs)
Definition: XML2Python.py:165
def XML2Python.TreeBuilder.__init__ (   self,
  kwargs 
)

Member Function Documentation

def XML2Python.TreeBuilder._name_mangle (   name)
staticprivate

Definition at line 108 of file XML2Python.py.

References XML2Python.TreeBuilder._name_mangle(), XML2Python.fixQuoteValue(), and XML2Python.xml2obj().

108  def _name_mangle (name):
109  return TreeBuilder.non_id_char.sub('_', name)
110 
111 
def XML2Python.TreeBuilder._name_mangle (   name)
staticprivate

Definition at line 204 of file XML2Python.py.

Referenced by XML2Python.TreeBuilder._name_mangle().

204  def _name_mangle (name):
205  return TreeBuilder.non_id_char.sub('_', name)
206 
207 
def XML2Python.TreeBuilder.characters (   self,
  content 
)

Definition at line 96 of file XML2Python.py.

References XML2Python.TreeBuilder.characters().

96  def characters (self, content):
97  self._text_parts.append(content)
98 
def characters(self, content)
Definition: XML2Python.py:192
def XML2Python.TreeBuilder.characters (   self,
  content 
)

Definition at line 192 of file XML2Python.py.

Referenced by XML2Python.TreeBuilder.characters().

192  def characters (self, content):
193  self._text_parts.append(content)
194 
def characters(self, content)
Definition: XML2Python.py:192
def XML2Python.TreeBuilder.endElement (   self,
  name 
)

Definition at line 84 of file XML2Python.py.

References XML2Python.TreeBuilder._text_parts, XML2Python.TreeBuilder.current, svgfig.Curve.Samples.current, XML2Python.TreeBuilder.endElement(), and digitizers_cfi.strip.

84  def endElement (self, name):
85  text = ''.join (self._text_parts).strip()
86  if text:
87  self.current._data = text
88  if self.current.attributes():
89  obj = self.current
90  else:
91  # a text only node is simply represented by the string
92  obj = text or ''
93  self.current, self._text_parts = self._stack.pop()
94  self.current._add_xml_attr (TreeBuilder._name_mangle(name), obj)
95 
def endElement(self, name)
Definition: XML2Python.py:180
def XML2Python.TreeBuilder.endElement (   self,
  name 
)

Definition at line 180 of file XML2Python.py.

References XML2Python.TreeBuilder._text_parts, XML2Python.TreeBuilder.current, svgfig.Curve.Samples.current, and digitizers_cfi.strip.

Referenced by XML2Python.TreeBuilder.endElement().

180  def endElement (self, name):
181  text = ''.join (self._text_parts).strip()
182  if text:
183  self.current._data = text
184  if self.current.attributes():
185  obj = self.current
186  else:
187  # a text only node is simply represented by the string
188  obj = text or ''
189  self.current, self._text_parts = self._stack.pop()
190  self.current._add_xml_attr (TreeBuilder._name_mangle(name), obj)
191 
def endElement(self, name)
Definition: XML2Python.py:180
def XML2Python.TreeBuilder.root (   self)

Definition at line 99 of file XML2Python.py.

References XML2Python.TreeBuilder._root, and XML2Python.TreeBuilder.root().

99  def root (self):
100  return self._root
101 
def XML2Python.TreeBuilder.root (   self)

Definition at line 195 of file XML2Python.py.

References XML2Python.TreeBuilder._root.

Referenced by XML2Python.TreeBuilder.root().

195  def root (self):
196  return self._root
197 
def XML2Python.TreeBuilder.startElement (   self,
  name,
  attrs 
)

Definition at line 76 of file XML2Python.py.

References XML2Python.DataNode._ncDict, XML2Python.TreeBuilder._ncDict, XML2Python.TreeBuilder._text_parts, XML2Python.TreeBuilder.current, svgfig.Curve.Samples.current, and XML2Python.TreeBuilder.startElement().

76  def startElement (self, name, attrs):
77  self._stack.append( (self.current, self._text_parts))
78  self.current = DataNode (nameChangeDict = self._ncDict)
79  self._text_parts = []
80  # xml attributes --> python attributes
81  for k, v in attrs.items():
82  self.current._add_xml_attr (TreeBuilder._name_mangle(k), v)
83 
def startElement(self, name, attrs)
Definition: XML2Python.py:172
def XML2Python.TreeBuilder.startElement (   self,
  name,
  attrs 
)

Definition at line 172 of file XML2Python.py.

References XML2Python.DataNode._ncDict, XML2Python.TreeBuilder._ncDict, XML2Python.TreeBuilder._text_parts, XML2Python.TreeBuilder.current, and svgfig.Curve.Samples.current.

Referenced by XML2Python.TreeBuilder.startElement().

172  def startElement (self, name, attrs):
173  self._stack.append( (self.current, self._text_parts))
174  self.current = DataNode (nameChangeDict = self._ncDict)
175  self._text_parts = []
176  # xml attributes --> python attributes
177  for k, v in attrs.items():
178  self.current._add_xml_attr (TreeBuilder._name_mangle(k), v)
179 
def startElement(self, name, attrs)
Definition: XML2Python.py:172
def XML2Python.TreeBuilder.topLevel (   self)
Returns top level object

Definition at line 102 of file XML2Python.py.

References XML2Python.TreeBuilder.topLevel(), and contentValuesCheck.values.

102  def topLevel (self):
103  '''Returns top level object'''
104  return self._root.attributes().values()[0]
105 
106 
def XML2Python.TreeBuilder.topLevel (   self)
Returns top level object

Definition at line 198 of file XML2Python.py.

References list(), and contentValuesCheck.values.

Referenced by XML2Python.TreeBuilder.topLevel().

198  def topLevel (self):
199  '''Returns top level object'''
200  return list(self._root.attributes().values())[0]
201 
202 
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Member Data Documentation

XML2Python.TreeBuilder._ncDict
private
XML2Python.TreeBuilder._root
private
XML2Python.TreeBuilder._stack
private

Definition at line 166 of file XML2Python.py.

Referenced by XML2Python.TreeBuilder.__init__().

XML2Python.TreeBuilder._text_parts
private
XML2Python.TreeBuilder.current
XML2Python.TreeBuilder.non_id_char
static

Definition at line 163 of file XML2Python.py.