From cfb9fb808ca043d7f463a067ab1600c248675120 Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Sat, 9 Jul 2016 16:53:28 +0200 Subject: [PATCH] worker: also return DummyDevice from ExamineDeviceMgr --- artiq/language/environment.py | 8 ++++++-- artiq/master/worker_impl.py | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/artiq/language/environment.py b/artiq/language/environment.py index b7b10052b..779d74fb8 100644 --- a/artiq/language/environment.py +++ b/artiq/language/environment.py @@ -213,8 +213,12 @@ class HasEnvironment: Other initialization steps such as requesting devices may also be performed here. - When the repository is scanned, any requested devices and arguments - are set to ``None``. + There are two situations where the requested devices are replaced by + ``DummyDevice()`` and arguments are set to their defaults (or ``None``) + instead: when the repository is scanned to build the list of + available experiments and when the dataset browser ``artiq_browser`` + is used to open or run the analysis stage of an experiment. Do not + rely on being able to operate on devices or arguments in ``build()``. Datasets are read-only in this method. diff --git a/artiq/master/worker_impl.py b/artiq/master/worker_impl.py index e1c6eb07a..ccdb11159 100644 --- a/artiq/master/worker_impl.py +++ b/artiq/master/worker_impl.py @@ -11,7 +11,7 @@ import artiq from artiq.protocols import pipe_ipc, pyon from artiq.protocols.packed_exceptions import raise_packed_exc from artiq.tools import multiline_log_config, file_import -from artiq.master.worker_db import DeviceManager, DatasetManager +from artiq.master.worker_db import DeviceManager, DatasetManager, DummyDevice from artiq.language.environment import (is_experiment, TraceArgumentManager, ProcessArgumentManager) from artiq.language.core import set_watchdog_factory, TerminationRequested @@ -124,7 +124,7 @@ class ExamineDeviceMgr: get_device_db = make_parent_action("get_device_db") def get(name): - return None + return DummyDevice() def examine(device_mgr, dataset_mgr, file):