mirror of https://github.com/m-labs/artiq.git
protocols/remote_exec: give access to controller_initial_namespace
This commit is contained in:
parent
69516136c4
commit
059836c591
|
@ -10,6 +10,8 @@ __all__ = ["RemoteExecServer", "RemoteExecClient", "simple_rexec_server_loop"]
|
||||||
class RemoteExecServer:
|
class RemoteExecServer:
|
||||||
def __init__(self, initial_namespace):
|
def __init__(self, initial_namespace):
|
||||||
self.namespace = dict(initial_namespace)
|
self.namespace = dict(initial_namespace)
|
||||||
|
# The module actually has to exist, otherwise it breaks e.g. Numba
|
||||||
|
self.namespace["__name__"] = "artiq.protocols.remote_exec"
|
||||||
|
|
||||||
def add_code(self, code):
|
def add_code(self, code):
|
||||||
exec(code, self.namespace)
|
exec(code, self.namespace)
|
||||||
|
@ -21,6 +23,7 @@ class RemoteExecServer:
|
||||||
def simple_rexec_server_loop(target_name, target, host, port,
|
def simple_rexec_server_loop(target_name, target, host, port,
|
||||||
description=None):
|
description=None):
|
||||||
initial_namespace = {"controller_driver": target}
|
initial_namespace = {"controller_driver": target}
|
||||||
|
initial_namespace["controller_initial_namespace"] = initial_namespace
|
||||||
targets = {
|
targets = {
|
||||||
target_name: target,
|
target_name: target,
|
||||||
target_name + "_rexec": lambda: RemoteExecServer(initial_namespace)
|
target_name + "_rexec": lambda: RemoteExecServer(initial_namespace)
|
||||||
|
|
Loading…
Reference in New Issue