From 08c7a530f8eead09802cd5f56facb93c9837fccf Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 28 Jan 2009 17:16:37 -0400 Subject: Extended the amount_t Python mapping to handle the 3rd case of value(). --- python/py_amount.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/py_amount.cc b/python/py_amount.cc index 69f4ded5..5a68b6d5 100644 --- a/python/py_amount.cc +++ b/python/py_amount.cc @@ -71,6 +71,11 @@ boost::optional py_value_1(const amount_t& amount, const boost::optional& moment) { return amount.value(moment); } +boost::optional py_value_2(const amount_t& amount, + const boost::optional& moment, + const boost::optional& in_terms_of) { + return amount.value(moment, in_terms_of); +} void py_parse_2(amount_t& amount, object in, unsigned char flags) { if (PyFile_Check(in.ptr())) { @@ -118,7 +123,7 @@ void export_amount() scope().attr("AMOUNT_PARSE_NO_MIGRATE") = AMOUNT_PARSE_NO_MIGRATE; scope().attr("AMOUNT_PARSE_NO_REDUCE") = AMOUNT_PARSE_NO_REDUCE; - class_< amount_t > ("amount") + class_< amount_t > ("Amount") #if 0 .def("initialize", &amount_t::initialize) .staticmethod("initialize") @@ -285,6 +290,7 @@ internal precision.") .def("value", py_value_0) .def("value", py_value_1) + .def("value", py_value_2) .def("sign", &amount_t::sign) .def("__nonzero__", &amount_t::is_nonzero) -- cgit v1.2.3