mirror of https://github.com/m-labs/artiq.git
sync_struct: pass mod to notify callback
This commit is contained in:
parent
070788a680
commit
33283feacb
|
@ -66,15 +66,15 @@ class Subscriber:
|
|||
line = yield from self._reader.readline()
|
||||
if not line:
|
||||
return
|
||||
obj = pyon.decode(line.decode())
|
||||
mod = pyon.decode(line.decode())
|
||||
|
||||
if obj["action"] == "init":
|
||||
target = self.target_builder(obj["struct"])
|
||||
if mod["action"] == "init":
|
||||
target = self.target_builder(mod["struct"])
|
||||
else:
|
||||
process_mod(target, obj)
|
||||
process_mod(target, mod)
|
||||
|
||||
if self.notify_cb is not None:
|
||||
self.notify_cb()
|
||||
self.notify_cb(mod)
|
||||
|
||||
|
||||
class Notifier:
|
||||
|
|
|
@ -201,7 +201,7 @@ def _show_list(args, notifier_name, display_fun):
|
|||
l[:] = x
|
||||
return l
|
||||
subscriber = Subscriber(notifier_name, init_l,
|
||||
lambda: display_fun(l))
|
||||
lambda mod: display_fun(l))
|
||||
_run_subscriber(args.server, args.port, subscriber)
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ def _show_dict(args, notifier_name, display_fun):
|
|||
d.update(x)
|
||||
return d
|
||||
subscriber = Subscriber(notifier_name, init_d,
|
||||
lambda: display_fun(d))
|
||||
lambda mod: display_fun(d))
|
||||
_run_subscriber(args.server, args.port, subscriber)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue