[pytango] 44/98: fix for `get_device_list` if server_name is '*'

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


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

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

commit 02ef9e6be85001a2099503ddb6cc7e8e08cdcbaa
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 892126d..c8002da 100644
--- a/src/boost/python/databaseds/db_access/beacon.py
+++ b/src/boost/python/databaseds/db_access/beacon.py
@@ -532,17 +532,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