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()
|
line = yield from self._reader.readline()
|
||||||
if not line:
|
if not line:
|
||||||
return
|
return
|
||||||
obj = pyon.decode(line.decode())
|
mod = pyon.decode(line.decode())
|
||||||
|
|
||||||
if obj["action"] == "init":
|
if mod["action"] == "init":
|
||||||
target = self.target_builder(obj["struct"])
|
target = self.target_builder(mod["struct"])
|
||||||
else:
|
else:
|
||||||
process_mod(target, obj)
|
process_mod(target, mod)
|
||||||
|
|
||||||
if self.notify_cb is not None:
|
if self.notify_cb is not None:
|
||||||
self.notify_cb()
|
self.notify_cb(mod)
|
||||||
|
|
||||||
|
|
||||||
class Notifier:
|
class Notifier:
|
||||||
|
|
|
@ -201,7 +201,7 @@ def _show_list(args, notifier_name, display_fun):
|
||||||
l[:] = x
|
l[:] = x
|
||||||
return l
|
return l
|
||||||
subscriber = Subscriber(notifier_name, init_l,
|
subscriber = Subscriber(notifier_name, init_l,
|
||||||
lambda: display_fun(l))
|
lambda mod: display_fun(l))
|
||||||
_run_subscriber(args.server, args.port, subscriber)
|
_run_subscriber(args.server, args.port, subscriber)
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ def _show_dict(args, notifier_name, display_fun):
|
||||||
d.update(x)
|
d.update(x)
|
||||||
return d
|
return d
|
||||||
subscriber = Subscriber(notifier_name, init_d,
|
subscriber = Subscriber(notifier_name, init_d,
|
||||||
lambda: display_fun(d))
|
lambda mod: display_fun(d))
|
||||||
_run_subscriber(args.server, args.port, subscriber)
|
_run_subscriber(args.server, args.port, subscriber)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue