Small cleanup in ElementBase.__setitem__
This commit is contained in:
@@ -254,8 +254,9 @@ class ElementBase(object):
|
|||||||
"""
|
"""
|
||||||
if attrib in self.interfaces:
|
if attrib in self.interfaces:
|
||||||
if value is not None:
|
if value is not None:
|
||||||
if hasattr(self, "set%s" % attrib.title()):
|
set_method = "set%s" % attrib.title()
|
||||||
getattr(self, "set%s" % attrib.title())(value,)
|
if hasattr(self, set_method):
|
||||||
|
getattr(self, set_method)(value,)
|
||||||
else:
|
else:
|
||||||
if attrib in self.sub_interfaces:
|
if attrib in self.sub_interfaces:
|
||||||
return self._setSubText(attrib, text=value)
|
return self._setSubText(attrib, text=value)
|
||||||
|
|||||||
Reference in New Issue
Block a user