def checked_property(name, valid):
def getter(self):
- value = self.__getattribute__("_"+name)
+ value = getattr(self, "_"+name)
if value not in valid:
raise InvalidValue(name, value)
return value
def setter(self, value):
if value not in valid:
raise InvalidValue(name, value)
- return self.__setattr__("_"+name, value)
+ return setattr(self, "_"+name, value)
return property(getter, setter)
severity_levels = ("wishlist", "minor", "serious", "critical", "fatal")
active = property(_get_active)
def add_attr(self, map, name):
- value = self.__getattribute__(name)
+ value = getattr(self, name)
if value is not None:
map[name] = value
map_names[name] = name
for name in names:
- value = obj.__getattribute__(name)
+ value = getattr(obj, name)
if value is not None:
map[map_names[name]] = value