ATLAS Offline Software
Public Member Functions | Public Attributes | Private Attributes | List of all members
python.XMLReader.TrigXMLElement Class Reference
Collaboration diagram for python.XMLReader.TrigXMLElement:

Public Member Functions

def __init__ (self, element)
 
def __str__ (self)
 
def __repr__ (self)
 
def __contains__ (self, k)
 
def __getitem__ (self, k)
 
def strippedText (self)
 
def readchildren (self)
 

Public Attributes

 element
 
 tag
 
 items
 
 children
 
 childtags
 

Private Attributes

 _childtagdict
 

Detailed Description

Definition at line 7 of file XMLReader.py.

Constructor & Destructor Documentation

◆ __init__()

def python.XMLReader.TrigXMLElement.__init__ (   self,
  element 
)

Definition at line 8 of file XMLReader.py.

8  def __init__(self,element):
9  self.element = element
10  self.tag = element.tag
11  self.items = element.items()
12  self.children = element.getchildren()
13  self.readchildren()

Member Function Documentation

◆ __contains__()

def python.XMLReader.TrigXMLElement.__contains__ (   self,
  k 
)

Definition at line 20 of file XMLReader.py.

20  def __contains__(self,k):
21  return k in dict(self.items)
22 

◆ __getitem__()

def python.XMLReader.TrigXMLElement.__getitem__ (   self,
  k 
)

Definition at line 23 of file XMLReader.py.

23  def __getitem__(self,k):
24  return dict(self.items)[k]
25 

◆ __repr__()

def python.XMLReader.TrigXMLElement.__repr__ (   self)

Definition at line 17 of file XMLReader.py.

17  def __repr__(self):
18  return self.tag
19 

◆ __str__()

def python.XMLReader.TrigXMLElement.__str__ (   self)

Definition at line 14 of file XMLReader.py.

14  def __str__(self):
15  s = "<%s%s>" % (" ".join([self.tag] + ['%s="%s"' % x for x in self.items]), "/" if len(self.children)==0 else "")
16  return s

◆ readchildren()

def python.XMLReader.TrigXMLElement.readchildren (   self)

Definition at line 29 of file XMLReader.py.

29  def readchildren(self):
30  self.childtags = []
31  self._childtagdict = {}
32  for c in self.children:
33  self._childtagdict.setdefault(c.tag,[]).append(TrigXMLElement(c))
34  if c.tag not in self.childtags: self.childtags += [c.tag]
35  for t in self.childtags:
36  self.__dict__['%ss'%t] = self._childtagdict[t]
37  if len(self._childtagdict[t])==1:
38  self.__dict__['%s'%t] = self._childtagdict[t][0]
39 
40 
41 

◆ strippedText()

def python.XMLReader.TrigXMLElement.strippedText (   self)

Definition at line 26 of file XMLReader.py.

26  def strippedText(self):
27  return self.element.text.strip()
28 

Member Data Documentation

◆ _childtagdict

python.XMLReader.TrigXMLElement._childtagdict
private

Definition at line 31 of file XMLReader.py.

◆ children

python.XMLReader.TrigXMLElement.children

Definition at line 12 of file XMLReader.py.

◆ childtags

python.XMLReader.TrigXMLElement.childtags

Definition at line 30 of file XMLReader.py.

◆ element

python.XMLReader.TrigXMLElement.element

Definition at line 9 of file XMLReader.py.

◆ items

python.XMLReader.TrigXMLElement.items

Definition at line 11 of file XMLReader.py.

◆ tag

python.XMLReader.TrigXMLElement.tag

Definition at line 10 of file XMLReader.py.


The documentation for this class was generated from the following file:
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.Bindings.__getitem__
__getitem__
Definition: Control/AthenaPython/python/Bindings.py:779
python.Bindings.__contains__
__contains__
Definition: Control/AthenaPython/python/Bindings.py:765