Mercurial > pytave
comparison python_to_octave.cc @ 350:e89a8a37fd8a
Rename the Octave-Python communication dict
* @pyobject/pyobject.m: Rename dict.
* octave_to_python.cc: Rename dict.
* pytave_utils.cc: Rename dict.
* python_to_octave.cc: Rename dict.
author | Colin Macdonald <cbm@m.fsf.org> |
---|---|
date | Thu, 11 Aug 2016 10:29:18 -0700 |
parents | d4744d829ee0 |
children | 826a23f63f75 |
comparison
equal
deleted
inserted
replaced
349:140e37e8e95a | 350:e89a8a37fd8a |
---|---|
320 object hex_function = builtins_module.attr ("hex"); | 320 object hex_function = builtins_module.attr ("hex"); |
321 object id_function = builtins_module.attr ("id"); | 321 object id_function = builtins_module.attr ("id"); |
322 object idtmp = hex_function (id_function (py_object)); | 322 object idtmp = hex_function (id_function (py_object)); |
323 std::string id = extract<std::string> (idtmp); | 323 std::string id = extract<std::string> (idtmp); |
324 | 324 |
325 // Ensure _InOctave dict exists | 325 // Ensure dict for Octave communication exists |
326 if (! PyObject_HasAttrString (main_module.ptr (), "_InOctave")) | 326 if (! PyObject_HasAttrString (main_module.ptr (), "_in_octave")) |
327 main_module.attr ("_InOctave") = boost::python::dict (); | 327 main_module.attr ("_in_octave") = boost::python::dict (); |
328 | 328 |
329 main_module.attr ("_InOctave")[id] = py_object; | 329 main_module.attr ("_in_octave")[id] = py_object; |
330 // Create @pyobject | 330 // Create @pyobject |
331 oct_value = feval ("pyobject", ovl (0, id), 2); | 331 oct_value = feval ("pyobject", ovl (0, id), 2); |
332 } | 332 } |
333 | 333 |
334 void pyobj_to_octvalue (octave_value& oct_value, | 334 void pyobj_to_octvalue (octave_value& oct_value, |