From aa086686ea2eb4efcb4684a48de8c15a97004a80 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 20 Nov 2009 17:40:15 -0500 Subject: Normalized the value() method for Python numerics --- src/py_balance.cc | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'src/py_balance.cc') diff --git a/src/py_balance.cc b/src/py_balance.cc index 5aed2b43..760730a7 100644 --- a/src/py_balance.cc +++ b/src/py_balance.cc @@ -45,28 +45,18 @@ using namespace boost::python; namespace { boost::optional py_value_0(const balance_t& balance) { - return balance.value(); + return balance.value(false, CURRENT_TIME()); } boost::optional py_value_1(const balance_t& balance, - const bool primary_only) { - return balance.value(primary_only); + commodity_t& in_terms_of) { + return balance.value(false, CURRENT_TIME(), in_terms_of); } - - boost::optional - py_value_2(const balance_t& balance, - const bool primary_only, - const boost::optional& moment) { - return balance.value(primary_only, moment); - } - - boost::optional - py_value_3(const balance_t& balance, - const bool primary_only, - const boost::optional& moment, - const boost::optional& in_terms_of) { - return balance.value(primary_only, moment, in_terms_of); + boost::optional py_value_2(const balance_t& balance, + commodity_t& in_terms_of, + datetime_t& moment) { + return balance.value(false, moment, in_terms_of); } - + boost::optional py_commodity_amount_0(const balance_t& balance) { return balance.commodity_amount(); @@ -200,9 +190,8 @@ void export_balance() return_internal_reference<>()) .def("value", py_value_0) - .def("value", py_value_1, args("primary_only")) - .def("value", py_value_2, args("primary_only", "moment")) - .def("value", py_value_3, args("primary_only", "moment", "in_terms_of")) + .def("value", py_value_1, args("in_terms_of")) + .def("value", py_value_2, args("in_terms_of", "moment")) .def("price", &balance_t::price) -- cgit v1.2.3