sim/ipc/Message: convert values

This commit is contained in:
Sebastien Bourdeauducq 2012-11-17 23:19:40 +01:00
parent e92af9de59
commit 89643bc434
2 changed files with 2 additions and 3 deletions

View File

@ -17,7 +17,7 @@ def gen():
r = TRead(i) r = TRead(i)
yield r yield r
ds.store = r.data ds.store = r.data
yield Token("result", {"r": int(ds)}) yield Token("result", {"r": ds})
class Dumper(SimActor): class Dumper(SimActor):
def __init__(self): def __init__(self):

View File

@ -14,8 +14,7 @@ class Int32(int):
class Message: class Message:
def __init__(self, *pvalues): def __init__(self, *pvalues):
for parameter, value in zip(self.parameters, pvalues): for parameter, value in zip(self.parameters, pvalues):
assert(isinstance(value, parameter[0])) setattr(self, parameter[1], parameter[0](value))
setattr(self, parameter[1], value)
def __str__(self): def __str__(self):
p = [] p = []