diff --git a/commands.py b/commands.py index a1cfd7f..ca05359 100644 --- a/commands.py +++ b/commands.py @@ -37,7 +37,7 @@ if home not in sys.path: # for newer Frappy installations this should be home (= /home/) # the following line fixes this in case nicos.conf is not yet updated sys.path.append(home) -from nicos_sinq.frappy.devices import FrappyNode +from nicos_sinq.frappy_sinq.devices import FrappyNode from servicemanager import FrappyManager @@ -68,7 +68,8 @@ def all_info(all_cfg): def applyAliasConfig(): """Apply the desired aliases from session.alias_config. - in addition, return the targets inheriting from SecopDevice + in addition, return the names of targets inheriting from SecopDevice + as a list """ # reimplemented from Session.applyAliasConfig # apply also when target dev name does not change, as the target device might have @@ -86,7 +87,7 @@ def applyAliasConfig(): if target in session.devices: try: aliasdev.alias = target - targets.append(target) + targets.append(target.name) except Exception: session.log.exception("could not set '%s' alias", aliasdev) break @@ -138,18 +139,15 @@ def frappy_start(service, cfg=None): cleanup_defunct() CreateAllDevices() targets = applyAliasConfig() - target_names = set(t.name for t in targets) newlist = [] - for devname in session.experiment.envlist: - devname, _, stat = devname.partition(':') + for itemname in session.experiment.envlist: + devname = itemname.split(':')[0] dev = session.devices.get(devname) - if dev is not None: - if isinstance(dev, SecopDevice): - if devname in target_names: - .... - else: - newlist.append(dev.name) - + if dev is not None and (not isinstance(dev, SecopDevice) or devname in targets): + newlist.append(itemname) + newlist.extend(t for t in targets if t not in newlist) + if newlist != session.experiment.envlist: + session.experiment.setEnvironment(newlist) if startnode and cfg == '': startnode.disable() return all_cfg diff --git a/setups/frappy.py b/setups/frappy.py index cec01b7..e17494b 100644 --- a/setups/frappy.py +++ b/setups/frappy.py @@ -1,7 +1,7 @@ description = 'frappy' group = 'optional' -modules = ['nicos_sinq.frappy.commands'] +modules = ['nicos_sinq.frappy_sinq.commands'] devices = { 'temperature': device('nicos.devices.generic.DeviceAlias'), diff --git a/setups/frappy_addons.py b/setups/frappy_addons.py index ba38fc9..a698af2 100644 --- a/setups/frappy_addons.py +++ b/setups/frappy_addons.py @@ -4,7 +4,7 @@ group = 'optional' devices = { 'se_addons': - device('nicos_sinq.frappy.devices.FrappyNode', + device('nicos_sinq.frappy_sinq.devices.FrappyNode', description='SEC node', unit='', prefix='se_', auto_create=True, service='addons', ), diff --git a/setups/frappy_main.py b/setups/frappy_main.py index 45cb75c..2d8be02 100644 --- a/setups/frappy_main.py +++ b/setups/frappy_main.py @@ -4,7 +4,7 @@ group = 'optional' devices = { 'se_main': - device('nicos_sinq.frappy.devices.FrappyNode', + device('nicos_sinq.frappy_sinq.devices.FrappyNode', description='main SEC node', unit='', prefix='se_', auto_create=True, service='main', ), diff --git a/setups/frappy_stick.py b/setups/frappy_stick.py index 9d2feae..c09560c 100644 --- a/setups/frappy_stick.py +++ b/setups/frappy_stick.py @@ -4,7 +4,7 @@ group = 'optional' devices = { 'se_stick': - device('nicos_sinq.frappy.devices.FrappyNode', + device('nicos_sinq.frappy_sinq.devices.FrappyNode', description='stick SEC node', unit='', prefix='se_', auto_create=True, service='stick', ),