Bug #2616

Inconsistency in MetaData __str__ function and actual field names

Added by N. Köster over 7 years ago. Updated over 7 years ago.

Status:ResolvedStart date:07/18/2016
Priority:NormalDue 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:

line with issue
API

rsb.metadata-naming-inconsistencies.patch Magnifier (880 Bytes) N. Köster, 07/18/2016 04:12 PM

Associated revisions

Revision 9e571e21
Added by N. Köster over 7 years ago

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 <>

History

#1 Updated by N. Köster over 7 years ago

  • Category set to Python

#2 Updated by J. Moringen over 7 years ago

  • Assignee set to J. Moringen
  • Target version set to rsb-0.15

#3 Updated by N. Köster over 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF