From 8b75b5cbfbb53e0bfa51c63dc96ade69617cd1db Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 29 Jan 2009 02:24:25 -0400 Subject: Revised the way that parsing flags get passed around. --- python/py_amount.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/py_amount.cc b/python/py_amount.cc index 195429a0..372b62f8 100644 --- a/python/py_amount.cc +++ b/python/py_amount.cc @@ -149,9 +149,6 @@ EXC_TRANSLATOR(amount_error) 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") .def("initialize", &amount_t::initialize) .staticmethod("initialize") @@ -385,6 +382,13 @@ internal precision.") .def("valid", &amount_t::valid) ; + enum_< amount_t::parse_flags_enum_t >("AmountParse") + .value("PARSE_DEFAULT", amount_t::PARSE_DEFAULT) + .value("PARSE_NO_MIGRATE", amount_t::PARSE_NO_MIGRATE) + .value("PARSE_NO_REDUCE", amount_t::PARSE_NO_REDUCE) + .value("PARSE_SOFT_FAIL", amount_t::PARSE_SOFT_FAIL) + ; + register_optional_to_python(); #ifdef HAVE_GDTOA -- cgit v1.2.3