[pytango] 114/483: fixes #3520739

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:31 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 40ce17d7401c2cbbacd50eaba7a3c758b1198c8c
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Tue Apr 24 10:15:08 2012 +0000

    fixes #3520739
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@20084 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 doc/revision.rst     |  1 +
 src/device_proxy.cpp | 23 +++++++++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/doc/revision.rst b/doc/revision.rst
index c65e8cf..0cf217c 100644
--- a/doc/revision.rst
+++ b/doc/revision.rst
@@ -85,6 +85,7 @@ Version history
 |            |         - `3487930: [pytango] wrong python dependency <https://sourceforge.net/tracker/?func=detail&aid=3487930&group_id=57612&atid=484769>`_                                |
 |            |         - `3511509: Attribute.set_value_date_quality for encoded does not work <https://sourceforge.net/tracker/?func=detail&aid=3511509&group_id=57612&atid=484769>`_       |
 |            |         - `3514457: [pytango]  TANGO_HOST multi-host support <https://sourceforge.net/tracker/?func=detail&aid=3514457&group_id=57612&atid=484769>`_                         |
+|            |         - `3520739: command_history(...) in  PyTango <https://sourceforge.net/tracker/?func=detail&aid=3520739&group_id=57612&atid=484769>`_                                 |
 +------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
 | 7.2.2      | Features:                                                                                                                                                                    |
 |            |     - from sourceforge:                                                                                                                                                      |
diff --git a/src/device_proxy.cpp b/src/device_proxy.cpp
index 0c82955..1c7dd69 100644
--- a/src/device_proxy.cpp
+++ b/src/device_proxy.cpp
@@ -164,12 +164,24 @@ namespace PyDeviceProxy
         return PyDeviceAttribute::convert_to_python(r_dev_attr.release(), self, extract_as);
     }
 
-
-    static inline vector<Tango::DeviceDataHistory>*
+    static inline object
             command_history(Tango::DeviceProxy& self, const std::string & cmd_name, int depth)
     {
-        AutoPythonAllowThreads guard;
-        return self.command_history(const_cast<std::string&>(cmd_name), depth);
+        vector<Tango::DeviceDataHistory>* device_data_hist = NULL;
+        boost::python::list ret;
+        {
+            AutoPythonAllowThreads guard;
+            device_data_hist =
+                self.command_history(const_cast<std::string&>(cmd_name), depth);
+        }
+        vector<Tango::DeviceDataHistory>::iterator it = device_data_hist->begin();
+        for(;it != device_data_hist->end(); ++it)
+        {
+            Tango::DeviceDataHistory& hist = *it;
+            ret.append(hist);
+        }
+        delete device_data_hist;
+        return ret;
     }
 
     static inline object
@@ -564,8 +576,7 @@ void export_device_proxy()
         //
 
         .def("command_history", &PyDeviceProxy::command_history,
-            (arg_("self"), arg_("cmd_name"), arg_("depth")),
-            return_value_policy<manage_new_object>() )
+            (arg_("self"), arg_("cmd_name"), arg_("depth")))
 
         .def("attribute_history", &PyDeviceProxy::attribute_history,
             (   arg_("self"),

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