old style PropertiesOptionError is now accepted
This commit is contained in:
parent
b49daa1b35
commit
8249b8eb20
|
@ -31,7 +31,7 @@ def display_list(lst, separator='and'):
|
||||||
# Exceptions for an Option
|
# Exceptions for an Option
|
||||||
class PropertiesOptionError(AttributeError):
|
class PropertiesOptionError(AttributeError):
|
||||||
"attempt to access to an option with a property that is not allowed"
|
"attempt to access to an option with a property that is not allowed"
|
||||||
def __init__(self, msg, proptype, settings, datas, option_type):
|
def __init__(self, msg, proptype, settings=None, datas=None, option_type=None):
|
||||||
self.proptype = proptype
|
self.proptype = proptype
|
||||||
self._settings = settings
|
self._settings = settings
|
||||||
self._datas = datas
|
self._datas = datas
|
||||||
|
@ -40,6 +40,9 @@ class PropertiesOptionError(AttributeError):
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
#this part is a bit slow, so only execute when display
|
#this part is a bit slow, so only execute when display
|
||||||
|
if self._settings is None:
|
||||||
|
req = {}
|
||||||
|
else:
|
||||||
req = self._settings.apply_requires(**self._datas)
|
req = self._settings.apply_requires(**self._datas)
|
||||||
if req != {}:
|
if req != {}:
|
||||||
msg = []
|
msg = []
|
||||||
|
|
Loading…
Reference in New Issue