fix issues raising pylint warnings
+ small bug fixes Change-Id: Ib63bf13ad06446d3ec3b8cd0b16f9426cef9e3f4
This commit is contained in:
@ -134,7 +134,7 @@ class HasProperties(HasDescriptors):
|
||||
propertyValues = None
|
||||
|
||||
def __init__(self):
|
||||
super(HasProperties, self).__init__()
|
||||
super().__init__()
|
||||
# store property values in the instance, keep descriptors on the class
|
||||
self.propertyValues = {}
|
||||
# pre-init
|
||||
@ -168,9 +168,9 @@ class HasProperties(HasDescriptors):
|
||||
if pn in getattr(base, 'propertyDict', {}):
|
||||
if callable(value):
|
||||
raise ProgrammingError('method %s.%s collides with property of %s' %
|
||||
(cls.__name__, pn, base.__name__))
|
||||
(cls.__name__, pn, base.__name__)) from None
|
||||
raise ProgrammingError('can not set property %s.%s to %r' %
|
||||
(cls.__name__, pn, value))
|
||||
(cls.__name__, pn, value)) from None
|
||||
cls.propertyDict[pn] = po
|
||||
|
||||
def checkProperties(self):
|
||||
@ -181,7 +181,7 @@ class HasProperties(HasDescriptors):
|
||||
self.propertyValues[pn] = po.datatype(self.propertyValues[pn])
|
||||
except (KeyError, BadValueError):
|
||||
name = getattr(self, 'name', self.__class__.__name__)
|
||||
raise ConfigError('%s.%s needs a value of type %r!' % (name, pn, po.datatype))
|
||||
raise ConfigError('%s.%s needs a value of type %r!' % (name, pn, po.datatype)) from None
|
||||
for pn, po in self.propertyDict.items():
|
||||
if pn.startswith('min'):
|
||||
maxname = 'max' + pn[3:]
|
||||
|
Reference in New Issue
Block a user