[pytango] 05/122: fix for `get_device_list` if server_name is '*'

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:18:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to tag v9.2.1
in repository pytango.

commit b624560fecff68df88beb616cee3ab1a26dacc1c
Author: blissadm <ohlsson at esrf.fr>
Date:   Wed Jun 1 13:28:28 2016 +0200

    fix for `get_device_list` if server_name is '*'
---
 src/boost/python/databaseds/db_access/beacon.py | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/boost/python/databaseds/db_access/beacon.py b/src/boost/python/databaseds/db_access/beacon.py
index fbd6b40..4103e24 100644
--- a/src/boost/python/databaseds/db_access/beacon.py
+++ b/src/boost/python/databaseds/db_access/beacon.py
@@ -517,17 +517,21 @@ class beacon(object):
 
     @_info
     def get_device_list(self,server_name, class_name ):
-        server_node = self._personal_2_node.get(server_name)
-        if server_node is None:
-            return []
-        device_list = server_node.get('device')
-        m = re.compile(class_name.replace('*','.*'))
-        if isinstance(device_list,list) :
-            return [x.get('tango_name') for x in device_list if m.match(x.get('class',''))]
-        elif isinstance(device_list,dict) and m.match(device_list.get('class','')) :
-            return [device_list.get('tango_name')]
+        if server_name == '*':
+            server_nodes = self._personal_2_node.values()
         else:
+            server_nodes = filter(None,[self._personal_2_node.get(server_name)])
+        if not server_nodes:
             return []
+        ret = list()
+        for server_node in server_nodes:
+            device_list = server_node.get('device')
+            m = re.compile(class_name.replace('*','.*'))
+            if isinstance(device_list,list) :
+                ret.extend([x.get('tango_name') for x in device_list if m.match(x.get('class',''))])
+            elif isinstance(device_list,dict) and m.match(device_list.get('class','')) :
+                ret.append(device_list.get('tango_name'))
+        return ret
     
     @_info
     def get_device_wide_list(self, wildcard):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git



More information about the debian-science-commits mailing list