diff options
Diffstat (limited to 'python/py_amount.cc')
-rw-r--r-- | python/py_amount.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/python/py_amount.cc b/python/py_amount.cc index 26107ce3..a12104d8 100644 --- a/python/py_amount.cc +++ b/python/py_amount.cc @@ -74,7 +74,8 @@ void py_parse_str_2(amount_t& amount, const string& str, unsigned char flags) { amount.parse(str, flags); } -void py_print(amount_t& amount, object out) { +void py_print(amount_t& amount, object out) +{ if (PyFile_Check(out.ptr())) { pyofstream outstr(reinterpret_cast<PyFileObject *>(out.ptr())); amount.print(outstr); @@ -84,6 +85,10 @@ void py_print(amount_t& amount, object out) { } } +void py_amount_initialize() { + amount_t::initialize(); +} + #define EXC_TRANSLATOR(type) \ void exc_translate_ ## type(const type& err) { \ PyErr_SetString(PyExc_ArithmeticError, err.what()); \ @@ -94,7 +99,7 @@ EXC_TRANSLATOR(amount_error) void export_amount() { class_< amount_t > ("Amount") - .def("initialize", &amount_t::initialize) + .def("initialize", py_amount_initialize) // only for the PyUnitTests .staticmethod("initialize") .def("shutdown", &amount_t::shutdown) .staticmethod("shutdown") @@ -103,12 +108,6 @@ void export_amount() make_getter(&amount_t::current_pool, return_value_policy<reference_existing_object>())) - .add_static_property("keep_base", &amount_t::keep_base) - - .add_static_property("keep_price", &amount_t::keep_price) - .add_static_property("keep_date", &amount_t::keep_date) - .add_static_property("keep_tag", &amount_t::keep_tag) - .add_static_property("stream_fullstrings", make_getter(&amount_t::stream_fullstrings), make_setter(&amount_t::stream_fullstrings)) |