Commit ea7dccda authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

ObjectMessage.getProperty() supports the default value like...

ObjectMessage.getProperty() supports the default value like Base.getProperty(). fix the format of __repr__().

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23211 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 851aaf97
...@@ -56,11 +56,11 @@ class ObjectMessage: ...@@ -56,11 +56,11 @@ class ObjectMessage:
""" """
self.__dict__.update(kw) self.__dict__.update(kw)
def getProperty(self, value): def getProperty(self, value, d=None):
""" """
A simple getter A simple getter
""" """
return getattr(self, value, None) return getattr(self, value, d)
def __getattr__(self, name): def __getattr__(self, name):
""" """
...@@ -90,7 +90,7 @@ class ObjectMessage: ...@@ -90,7 +90,7 @@ class ObjectMessage:
def __repr__(self): def __repr__(self):
repr_str = '<%s object at 0x%x\n ' % (self.__class__.__name__, id(self)) repr_str = '<%s object at 0x%x\n ' % (self.__class__.__name__, id(self))
repr_str += ' \n'.join([' %r: %r' % (k, v) \ repr_str += '\n '.join([' %r: %r' % (k, v) \
for k, v in self.__dict__.items()]) for k, v in self.__dict__.items()])
repr_str += '>' repr_str += '>'
return repr_str return repr_str
......
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