[pytango] 415/483: Fix #686

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


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

sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.

commit 4d467eda4ddf91943670c5f40e0628904e877e78
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Tue Sep 30 12:59:53 2014 +0000

    Fix #686
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@26602 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 doc/revision.rst           |  2 ++
 src/boost/python/server.py | 10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/doc/revision.rst b/doc/revision.rst
index d0b6160..f4bf26a 100644
--- a/doc/revision.rst
+++ b/doc/revision.rst
@@ -97,8 +97,10 @@ Version history
 |          | Bug fixes:                                                                                                                                                            |
 |          |                                                                                                                                                                       |
 |          |     - `659: segmentation fault when unsubscribing from events <https://sourceforge.net/p/tango-cs/bugs/659/>`_                                                        |
+|          |     - `678: [pytango] 8.1.2 unexpected files in the source package  <https://sourceforge.net/p/tango-cs/bugs/678/>`_                                                  |
 |          |     - `679: PyTango.server tries to import missing __builtin__ module on Python 3 <https://sourceforge.net/p/tango-cs/bugs/679/>`_                                    |
 |          |     - `680: Cannot import PyTango.server.run <https://sourceforge.net/p/tango-cs/bugs/680/>`_                                                                         |
+|          |     - `686: Device property substitution for a multi-device server <https://sourceforge.net/p/tango-cs/bugs/686/>`_                                                   |
 +----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | 8.1.3    | *SKIPPED*                                                                                                                                                             |
 +----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/src/boost/python/server.py b/src/boost/python/server.py
index d31dc8a..40096a6 100644
--- a/src/boost/python/server.py
+++ b/src/boost/python/server.py
@@ -326,10 +326,12 @@ def create_tango_deviceclass_klass(tango_device_klass, attrs=None):
             attr_list[attr_name] = attr_obj
             check_dev_klass_attr_methods(tango_device_klass, attr_obj)
         elif isinstance(attr_obj, device_property):
+            attr_obj.name = attr_name
             device_property_list[attr_name] = [attr_obj.dtype,
                                                attr_obj.doc,
                                                attr_obj.default_value]
         elif isinstance(attr_obj, class_property):
+            attr_obj.name = attr_name
             class_property_list[attr_name] = [attr_obj.dtype,
                                               attr_obj.doc,
                                               attr_obj.default_value]
@@ -401,6 +403,7 @@ class Device(LatestDeviceImpl):
     inherit from this class."""
 
     def __init__(self, cl, name):
+        self._tango_properties = {}
         LatestDeviceImpl.__init__(self, cl, name)
         self.init_device()
 
@@ -678,6 +681,7 @@ def command(f=None, dtype_in=None, dformat_in=None, doc_in="",
 class _property(object):
 
     def __init__(self, dtype, doc='', default_value=None):
+        self.name = None
         self.__value = None
         dtype = from_typeformat_to_type(*_get_tango_type_format(dtype))
         self.dtype = dtype
@@ -685,13 +689,13 @@ class _property(object):
         self.default_value = default_value
 
     def __get__(self, obj, objtype):
-        return self.__value
+        return obj._tango_properties.get(self.name)
 
     def __set__(self, obj, value):
-        self.__value = value
+        obj._tango_properties[self.name] = value
 
     def __delete__(self, obj):
-        del self.__value
+        del obj._tango_properties[self.name]
 
 
 class device_property(_property):

-- 
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