[cig-commits] r12965 - cs/cigma/trunk/pysrc
luis at geodynamics.org
luis at geodynamics.org
Wed Sep 24 06:22:06 PDT 2008
Author: luis
Date: 2008-09-24 06:22:06 -0700 (Wed, 24 Sep 2008)
New Revision: 12965
Modified:
cs/cigma/trunk/pysrc/README
cs/cigma/trunk/pysrc/pycigma.cpp
Log:
Update to Python/C++ bindings (add properties and __str__ method)
Modified: cs/cigma/trunk/pysrc/README
===================================================================
--- cs/cigma/trunk/pysrc/README 2008-09-24 13:22:04 UTC (rev 12964)
+++ cs/cigma/trunk/pysrc/README 2008-09-24 13:22:06 UTC (rev 12965)
@@ -3,6 +3,12 @@
To facilitate the build procedure, we make use of distutils to
compile the Boost.Python module.
-
http://pydoc.org/2.5.1/distutils.extension.html
+
+Other projects that use Boost.Python bindings include
+
+ MeshPy: http://mathema.tician.de/software/meshpy
+ CGAL-Python: http://cgal-python.gforge.inria.fr/
+ Ledger: http://github.com/jwiegley/ledger/tree/master
+
Modified: cs/cigma/trunk/pysrc/pycigma.cpp
===================================================================
--- cs/cigma/trunk/pysrc/pycigma.cpp 2008-09-24 13:22:04 UTC (rev 12964)
+++ cs/cigma/trunk/pysrc/pycigma.cpp 2008-09-24 13:22:06 UTC (rev 12965)
@@ -6,12 +6,11 @@
{
class_<DataPath>("DataPath", no_init)
.def(init<std::string>())
+ .def(self_ns::str(self)) // __str__
.def("exists", &DataPath::exists)
.def("empty", &DataPath::empty)
.def("extension", &DataPath::extension)
- .def("filename", &DataPath::filename)
- .def("location", &DataPath::location)
- .def("set_filename", &DataPath::set_filename)
- .def("set_location", &DataPath::set_location)
+ .add_property("filename", &DataPath::filename, &DataPath::set_filename)
+ .add_property("location", &DataPath::location, &DataPath::set_location)
;
}
More information about the cig-commits
mailing list