summaryrefslogtreecommitdiff
path: root/src/py_value.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-04-26 16:39:25 -0500
committerJohn Wiegley <johnw@newartisans.com>2012-04-26 16:39:25 -0500
commit64a9b42381c26baf24e58b40f50f0b253e551811 (patch)
tree5447a29dff64c3a8b7be8100a01bcb4a2d73b0bb /src/py_value.cc
parent7cc550fc22357e2ded194d3e65287c6b3317f5ae (diff)
parentb4407c10c0071365322b2963747bf42a57fd7304 (diff)
downloadfork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.tar.gz
fork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.tar.bz2
fork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.zip
Merge branch 'release/v3.0.0-20120426'
Diffstat (limited to 'src/py_value.cc')
-rw-r--r--src/py_value.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/py_value.cc b/src/py_value.cc
index f8f36453..b931f008 100644
--- a/src/py_value.cc
+++ b/src/py_value.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2010, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2012, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -51,14 +51,19 @@ namespace {
return value.value(CURRENT_TIME());
}
boost::optional<value_t> py_value_1(const value_t& value,
- commodity_t& in_terms_of) {
+ const commodity_t * in_terms_of) {
return value.value(CURRENT_TIME(), in_terms_of);
}
boost::optional<value_t> py_value_2(const value_t& value,
- commodity_t& in_terms_of,
- datetime_t& moment) {
+ const commodity_t * in_terms_of,
+ const datetime_t& moment) {
return value.value(moment, in_terms_of);
}
+ boost::optional<value_t> py_value_2d(const value_t& value,
+ const commodity_t * in_terms_of,
+ const date_t& moment) {
+ return value.value(datetime_t(moment), in_terms_of);
+ }
PyObject * py_base_type(value_t& value)
{
@@ -147,7 +152,7 @@ void export_value()
.def(init<balance_t>())
.def(init<mask_t>())
.def(init<std::string>())
- // jww (2009-11-02): Need to support conversion eof value_t::sequence_t
+ // jww (2009-11-02): Need to support conversion of value_t::sequence_t
//.def(init<value_t::sequence_t>())
.def(init<value_t>())
@@ -265,9 +270,9 @@ void export_value()
.def("value", py_value_0)
.def("value", py_value_1, args("in_terms_of"))
.def("value", py_value_2, args("in_terms_of", "moment"))
+ .def("value", py_value_2d, args("in_terms_of", "moment"))
- .def("value", &value_t::value, value_overloads())
- .def("price", &value_t::price)
+ //.def("value", &value_t::value, value_overloads())
.def("exchange_commodities", &value_t::exchange_commodities,
exchange_commodities_overloads())