Added optional default value to _getAttr.
This commit is contained in:
parent
cbed8029ba
commit
1cedea2804
2 changed files with 5 additions and 2 deletions
|
@ -49,6 +49,9 @@ class Iq(RootStanza):
|
|||
Stanza Interface:
|
||||
query -- The namespace of the <query> element if one exists.
|
||||
|
||||
Attributes:
|
||||
types -- May be one of: get, set, result, or error.
|
||||
|
||||
Methods:
|
||||
__init__ -- Overrides StanzaBase.__init__.
|
||||
unhandled -- Send error if there are no handlers.
|
||||
|
|
|
@ -235,8 +235,8 @@ class ElementBase(tostring.ToString):
|
|||
if name in self.xml.attrib:
|
||||
del self.xml.attrib[name]
|
||||
|
||||
def _getAttr(self, name):
|
||||
return self.xml.attrib.get(name, '')
|
||||
def _getAttr(self, name, default=''):
|
||||
return self.xml.attrib.get(name, default)
|
||||
|
||||
def _getSubText(self, name):
|
||||
if '}' not in name:
|
||||
|
|
Loading…
Reference in a new issue