Bug #2616
Inconsistency in MetaData __str__ function and actual field names
Status: | Resolved | Start date: | 07/18/2016 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | J. Moringen | % Done: | 100% | |
Category: | Python | |||
Target version: | rsb-0.15 |
Description
There is an inconsistency in the __str__
function of the MetaData class and the naming of the actual field of the class.
Example:
In [1]: import rsb In [2]: a=rsb.Event() In [3]: print a Event[id = None, scope = 'Scope[/]', data = 'None', type = '<type 'object'>', method = 'None', metaData = MetaData[create = 1468851183.69, send = None, receive = None, deliver = None, userTimes = {}, userInfos = {}], causes = []] In [4]: a.metaData.create --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-4-a56d9880b1f7> in <module>() ----> 1 a.metaData.create AttributeError: 'MetaData' object has no attribute 'create' In [5]: a.metaData.send --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-3f713903c3a3> in <module>() ----> 1 a.metaData.send AttributeError: 'MetaData' object has no attribute 'send' In [6]: a.metaData.createTime Out[6]: 1468851183.694944
This behaviour is unexpected and might confuse users. The easy fix is to use the actual field name in the __str__
function. Patch attached.
Refs:
Associated revisions
Fix inconsistent MetaData.__str__ method in rsb/__init__.py
fixes #2616
- rsb/__init__.py (MetaData.__str__): in output text, changed {create,send,receive,deliver} -> {create,send,receive,deliver}Time
Signed-off-by: Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
History
#1 Updated by N. Köster almost 8 years ago
- Category set to Python
#2 Updated by J. Moringen almost 8 years ago
- Assignee set to J. Moringen
- Target version set to rsb-0.15
#3 Updated by N. Köster almost 8 years ago
- Status changed from New to Resolved
- % Done changed from 0 to 100
Applied in changeset rsb-python|9e571e21bb02acc09303f75dcbe04aa6167a832e.