Groups and wildcards

Dear all,

I would like a flexible way to add devices to a group. For example, I could do the following:


import PyTango
tpm_grp = PyTango.Group("TPMs")
tpm_grp.add("test/tpm_board/1")
tpm_grp.add("test/tpm_board/2")

Whilst this works, there could be many such devices, and I'd like to add them all at once via a wildcard. So I would like something like:


import PyTango
tpm_grp = PyTango.Group("TPMs")
tpm_grp.add("test/tpm_board/*")

Based on the API documentation here, it should be possible to do via the method:


add(self, patterns, timeout_ms=-1) -> None

The code seems to execute, however I get an empty list when I then do:

print tpm_grp.get_device_list()

Am I missing something?

Thanks,
Andrea
Dr Andrea DeMarco, BSc (Hons) (Melita), MSc (Melita), DPhil (UEA)
Lecturer | Researcher
Department of Physics
Institute of Space Sciences and Astronomy

Room 220, Maths and Physics Building
University of Malta, Msida MSD2080, MALTA
Hi Andrea,

I cannot reproduce your problem.
I tried with:
  • Tango 8.1.2 & PyTango 8.1.8
  • Tango 9.2.1 & PyTango 9.2.0 alpha


Can you tell me the versions your are using?
It is easy if you do:

>>> import PyTango.utils
>>> print (PyTango.utils.info())
PyTango 9.2.0 (9, 2, 0, 'a', 1)
PyTango compiled with:
    Python : 2.7.6
    Numpy  : 1.8.2
    Tango  : 9.2.1
    Boost  : 1.54.0

PyTango runtime is:
    Python : 2.7.6
    Numpy  : 1.8.2
    Tango  : 9.2.1
    Boost  : 0.0.0

PyTango running on:
('Linux', 'bcu01ctrl', '3.13.0-37-generic', '#64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014', 'x86_64', 'x86_64')


Also could you send the result of doing:

>>> import PyTango
>>> db = PyTango.Database()
>>> print (db.get_device_member('test/tpm_board/*')

Thanks in advance
Tiago
Hi Tiago,

Thanks for the reply. For some weird reason, the problem "disappeared" after restarting my machine this morning….

But just in case, here's my setup:

PyTango 8.1.8 (8, 1, 8, 'final', 0)
PyTango compiled with:
    Python : 2.7.6
    Numpy  : 1.8.2
    Tango  : 8.1.2
    Boost  : 1.55.0

PyTango runtime is:
    Python : 2.7.6
    Numpy  : 1.8.2
    Tango  : 8.1.2
    Boost  : 0.0.0

PyTango running on:
('Linux', 'aavs', '3.16.0-62-generic', '#83~14.04.1-Ubuntu SMP Fri Feb 26 22:52:39 UTC 2016', 'x86_64', 'x86_64')   

Thanks,
Andrea
Dr Andrea DeMarco, BSc (Hons) (Melita), MSc (Melita), DPhil (UEA)
Lecturer | Researcher
Department of Physics
Institute of Space Sciences and Astronomy

Room 220, Maths and Physics Building
University of Malta, Msida MSD2080, MALTA
 
Register or login to create to post a reply.