summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-01-29 02:24:25 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-01-29 02:24:25 -0400
commit8b75b5cbfbb53e0bfa51c63dc96ade69617cd1db (patch)
treec10c7ea058d0491988078093ad27bac2f9ba240c /python
parent5b388af6264b1bff5ff143db4120e4776d06c90c (diff)
downloadfork-ledger-8b75b5cbfbb53e0bfa51c63dc96ade69617cd1db.tar.gz
fork-ledger-8b75b5cbfbb53e0bfa51c63dc96ade69617cd1db.tar.bz2
fork-ledger-8b75b5cbfbb53e0bfa51c63dc96ade69617cd1db.zip
Revised the way that parsing flags get passed around.
Diffstat (limited to 'python')
-rw-r--r--python/py_amount.cc10
1 files changed, 7 insertions, 3 deletions
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<amount_t>();
#ifdef HAVE_GDTOA