Definition at line 698 of file AtlRunQueryUtils.py.
◆ __init__()
def python.utils.AtlRunQueryUtils.XMLReader.XMLElement.__init__ |
( |
|
self, |
|
|
|
element |
|
) |
| |
Definition at line 699 of file AtlRunQueryUtils.py.
700 self.element = element
701 self.tag = element.tag
702 self.attributes = dict(element.items())
703 self.children =
list(element)
◆ __getattr__()
def python.utils.AtlRunQueryUtils.XMLReader.XMLElement.__getattr__ |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 729 of file AtlRunQueryUtils.py.
729 def __getattr__(self,name):
730 raise AttributeError (
"'%s'. XML element '%s' has tags %s" % (name,self.tag, [
"%ss" % t
for t
in self.childtags]))
◆ __getitem__()
def python.utils.AtlRunQueryUtils.XMLReader.XMLElement.__getitem__ |
( |
|
self, |
|
|
|
k |
|
) |
| |
Definition at line 712 of file AtlRunQueryUtils.py.
713 if k
not in self.attributes:
714 raise KeyError (
"'%s'. XML element '%s' has attributes %s" % (k,self.tag, self.attributes.
keys()))
715 return self.attributes[k]
◆ __repr__()
def python.utils.AtlRunQueryUtils.XMLReader.XMLElement.__repr__ |
( |
|
self | ) |
|
◆ __str__()
def python.utils.AtlRunQueryUtils.XMLReader.XMLElement.__str__ |
( |
|
self | ) |
|
Definition at line 708 of file AtlRunQueryUtils.py.
709 return "<%s %s>" % (self.tag,
" ".
join([
'%s="%s"' % x
for x
in self.items()]))
◆ items()
def python.utils.AtlRunQueryUtils.XMLReader.XMLElement.items |
( |
|
self | ) |
|
◆ readchildren()
def python.utils.AtlRunQueryUtils.XMLReader.XMLElement.readchildren |
( |
|
self | ) |
|
Definition at line 717 of file AtlRunQueryUtils.py.
717 def readchildren(self):
719 self._childtagdict = {}
720 for c
in self.children:
721 self._childtagdict.setdefault(c.tag,[]).
append(XMLReader.XMLElement(c))
722 if c.tag
not in self.childtags:
723 self.childtags += [c.tag]
724 for t
in self.childtags:
725 self.__dict__[
'%ss'%t] = self._childtagdict[t]
726 if len(self._childtagdict[t])==1:
727 self.__dict__[
'%s'%t] = self._childtagdict[t][0]
◆ _childtagdict
python.utils.AtlRunQueryUtils.XMLReader.XMLElement._childtagdict |
|
private |
◆ attributes
python.utils.AtlRunQueryUtils.XMLReader.XMLElement.attributes |
◆ children
python.utils.AtlRunQueryUtils.XMLReader.XMLElement.children |
◆ childtags
python.utils.AtlRunQueryUtils.XMLReader.XMLElement.childtags |
◆ element
python.utils.AtlRunQueryUtils.XMLReader.XMLElement.element |
◆ tag
python.utils.AtlRunQueryUtils.XMLReader.XMLElement.tag |
The documentation for this class was generated from the following file: