fix formatting of timestamps
Change-Id: I92e714833f333b13257e8e54561aa18716d89ecb
This commit is contained in:
parent
79ca140874
commit
dc891466cb
@ -138,12 +138,16 @@ class Value(object):
|
||||
self.value = value
|
||||
self.__dict__.update(qualifiers)
|
||||
if 't' in qualifiers:
|
||||
self.t = parse_time(qualifiers['t'])
|
||||
try:
|
||||
self.t = float(qualifiers['t'])
|
||||
except Exception:
|
||||
self.t = parse_time(qualifiers['t'])
|
||||
|
||||
def __repr__(self):
|
||||
r = []
|
||||
if self.t is not None:
|
||||
r.append("timestamp=%r" % format_time(self.t))
|
||||
print("Check 3")
|
||||
if self.u is not None:
|
||||
r.append('unit=%r' % self.u)
|
||||
if self.e is not None:
|
||||
|
@ -42,6 +42,7 @@ class MessageEncoder(object):
|
||||
from .demo_v2 import DemoEncoder as DemoEncoderV2
|
||||
from .demo_v3 import DemoEncoder as DemoEncoderV3
|
||||
from .demo_v4 import DemoEncoder as DemoEncoderV4
|
||||
from .demo_v5 import DemoEncoder as DemoEncoderV5
|
||||
from .text import TextEncoder
|
||||
from .pickle import PickleEncoder
|
||||
from .simplecomm import SCPEncoder
|
||||
@ -52,7 +53,8 @@ ENCODERS = {
|
||||
'demo_v2': DemoEncoderV2,
|
||||
'demo_v3': DemoEncoderV3,
|
||||
'demo_v4': DemoEncoderV4,
|
||||
'demo': DemoEncoderV4,
|
||||
'demo_v5': DemoEncoderV5,
|
||||
'demo': DemoEncoderV5,
|
||||
'scp': SCPEncoder,
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@
|
||||
|
||||
import random
|
||||
|
||||
from secop.lib.parsing import format_time
|
||||
from secop.datatypes import EnumType, TupleOf, FloatRange, get_datatype, StringType
|
||||
from secop.modules import Readable, Device, Driveable, PARAM
|
||||
from secop.protocol import status
|
||||
|
Loading…
x
Reference in New Issue
Block a user