Definition at line 7 of file XMLReader.py.
◆ __init__()
def python.XMLReader.TrigXMLElement.__init__ |
( |
|
self, |
|
|
|
element |
|
) |
| |
Definition at line 8 of file XMLReader.py.
10 self.tag = element.tag
11 self.items = element.items()
12 self.children = element.getchildren()
◆ __contains__()
def python.XMLReader.TrigXMLElement.__contains__ |
( |
|
self, |
|
|
|
k |
|
) |
| |
Definition at line 20 of file XMLReader.py.
21 return k
in dict(self.items)
◆ __getitem__()
def python.XMLReader.TrigXMLElement.__getitem__ |
( |
|
self, |
|
|
|
k |
|
) |
| |
Definition at line 23 of file XMLReader.py.
24 return dict(self.items)[k]
◆ __repr__()
def python.XMLReader.TrigXMLElement.__repr__ |
( |
|
self | ) |
|
◆ __str__()
def python.XMLReader.TrigXMLElement.__str__ |
( |
|
self | ) |
|
Definition at line 14 of file XMLReader.py.
15 s =
"<%s%s>" % (
" ".
join([self.tag] + [
'%s="%s"' % x
for x
in self.items]),
"/" if len(self.children)==0
else "")
◆ readchildren()
def python.XMLReader.TrigXMLElement.readchildren |
( |
|
self | ) |
|
Definition at line 29 of file XMLReader.py.
29 def readchildren(self):
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]
◆ 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()
◆ _childtagdict
python.XMLReader.TrigXMLElement._childtagdict |
|
private |
◆ children
python.XMLReader.TrigXMLElement.children |
◆ childtags
python.XMLReader.TrigXMLElement.childtags |
◆ element
python.XMLReader.TrigXMLElement.element |
◆ items
python.XMLReader.TrigXMLElement.items |
◆ tag
python.XMLReader.TrigXMLElement.tag |
The documentation for this class was generated from the following file: