After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 567144 - Use boost::python instead of the Python C API.
Use boost::python instead of the Python C API.
Status: RESOLVED FIXED
Product: glom
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Murray Cumming
Murray Cumming
Depends on:
Blocks:
 
 
Reported: 2009-01-09 11:25 UTC by Murray Cumming
Modified: 2010-03-09 15:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glom_boost_python.patch (32.10 KB, patch)
2009-02-21 12:00 UTC, Murray Cumming
needs-work Details | Review
glom_boost_python_with_module.patch (40.68 KB, patch)
2009-02-23 13:27 UTC, Murray Cumming
needs-work Details | Review
glom_boost_python_with_module2.patch (46.76 KB, patch)
2009-02-24 22:39 UTC, Murray Cumming
none Details | Review

Description Murray Cumming 2009-01-09 11:25:21 UTC
We have a Glom Python module implemented with the Python C API. I would like to see how that looks when reimplemented with boost::python.

If that looks nicer then it would help us to expand our python API.
Comment 1 Murray Cumming 2009-02-21 12:00:29 UTC
Created attachment 129208 [details] [review]
glom_boost_python.patch

This is an additional attempt to use boost::python for just the execuction of Python functions, not yet using boost::python to implement our Python module.

However, I can't seem to instantiate the glom.Record type, which we do with PyObject_Call(type), with the C API.
Comment 2 Murray Cumming 2009-02-23 13:27:49 UTC
Created attachment 129320 [details] [review]
glom_boost_python_with_module.patch

This one also uses boost::python to create the Glom python module. It certainly looks much nicer, though it is almost totally untested. The [] subscripting does not work, and I'm not even sure that this is how it should be implemented. Also we should probably use boost::python::object where we are now still using PyObject*.

Note that the "self = this" variables are just to keep the code changes to a minimum to make the patch readable. Later we will remove them.

Anyway, the first patch should be fixed first.
Comment 3 Murray Cumming 2009-02-24 22:39:13 UTC
Created attachment 129433 [details] [review]
glom_boost_python_with_module2.patch

No progress on the embedded part, but the module is much better now, though the map seems to be NULL when we call PyGlomRecord::getitem().
Comment 4 Murray Cumming 2010-03-09 15:18:55 UTC
This is now done.