Commit d1e0d579 authored by Vincent Pelletier's avatar Vincent Pelletier

Update getProperty to follow the current prototype defined in ERP5Type/Base.py.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@13054 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 54d5ed84
......@@ -48,6 +48,8 @@ class ActiveResult:
WARNING = 100
ERROR = 200
PANIC = 300
# getProperty default
_MARKER = None
def __init__(self,summary='',severity=INFO,detail='',**kw):
"""
......@@ -70,11 +72,11 @@ class ActiveResult:
del kw['object_path']
self.__dict__.update(kw)
def getProperty(self,value):
def getProperty(self,value,d=_MARKER,**kw):
"""
A simple getter
"""
return getattr(self,value,None)
return getattr(self,value,d)
def getResult(self):
"""
......
......@@ -43,6 +43,8 @@ class Error:
WARNING = 100
ERROR = 200
PANIC = 300
# Marker for getProperty
_MARKER = None
def __init__(self,summary='',severity=INFO,detail='',**kw):
"""
......@@ -65,10 +67,10 @@ class Error:
del kw['object_path']
self.__dict__.update(kw)
def getProperty(self,value):
def getProperty(self, key, d=_MARKER, **kw):
"""
A simple getter
"""
return getattr(self,value,None)
return getattr(self, value, d)
allow_class(Error)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment