From 0c890de44bfd33060c36c7b1f182079982232cf7 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 14 Sep 2004 17:34:48 -0400 Subject: main.py now implements nearly all the functionality of main.cc --- walk.cc | 77 ++++++++++++++++++++++++++++++++--------------------------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'walk.cc') diff --git a/walk.cc b/walk.cc index cfecf392..790369da 100644 --- a/walk.cc +++ b/walk.cc @@ -347,98 +347,97 @@ void py_walk_transactions(entry_t& entry, item_handler& handler) void export_walk() { - class_< item_handler, - item_handler_wrap > ("TransactionHandler") - .def(init *>()) + typedef item_handler xact_handler_t; - .def("flush", &item_handler::flush, + class_< xact_handler_t, item_handler_wrap > + ("TransactionHandler") + .def(init()) + + .def("flush", &xact_handler_t::flush, &item_handler_wrap::default_flush) - .def("__call__", &item_handler::operator(), + .def("__call__", &xact_handler_t::operator(), &item_handler_wrap::default_call) ; - class_< ignore_transactions > ("IgnoreTransactions") - .def("flush", &item_handler::flush) + class_< ignore_transactions, bases > + ("IgnoreTransactions") + .def("flush", &xact_handler_t::flush) .def("__call__", &ignore_transactions::operator()); ; - class_< clear_transaction_data > ("ClearTransactionData") - .def("flush", &item_handler::flush) + class_< clear_transaction_data, bases > + ("ClearTransactionData") + .def("flush", &xact_handler_t::flush) .def("__call__", &clear_transaction_data::operator()); ; - class_< set_account_value > - ("SetAccountValue", init *>() + class_< set_account_value, bases > + ("SetAccountValue", init() [with_custodian_and_ward<1, 2>()]) - .def("flush", &item_handler::flush) + .def("flush", &xact_handler_t::flush) .def("__call__", &set_account_value::operator()); ; -#if 0 - class_< sort_transactions > - ("SortTransactions", init *>() + class_< sort_transactions, bases > + ("SortTransactions", init() [with_custodian_and_ward<1, 2>()]) .def("flush", &sort_transactions::flush) .def("__call__", &sort_transactions::operator()); ; -#endif - class_< filter_transactions > - ("FilterTransactions", init *, std::string>() + class_< filter_transactions, bases > + ("FilterTransactions", init() [with_custodian_and_ward<1, 2>()]) - .def("flush", &item_handler::flush) + .def("flush", &xact_handler_t::flush) .def("__call__", &filter_transactions::operator()); ; - class_< calc_transactions > - ("CalcTransactions", init *, optional >() + class_< calc_transactions, bases > + ("CalcTransactions", init >() [with_custodian_and_ward<1, 2>()]) - .def("flush", &item_handler::flush) + .def("flush", &xact_handler_t::flush) .def("__call__", &calc_transactions::operator()); ; - class_< collapse_transactions > - ("CollapseTransactions", init *>() + class_< collapse_transactions, bases > + ("CollapseTransactions", init() [with_custodian_and_ward<1, 2>()]) .def("flush", &collapse_transactions::flush) .def("__call__", &collapse_transactions::operator()); ; - class_< changed_value_transactions > - ("ChangeValueTransactions", init *, bool>() + class_< changed_value_transactions, bases > + ("ChangeValueTransactions", init() [with_custodian_and_ward<1, 2>()]) .def("flush", &changed_value_transactions::flush) .def("__call__", &changed_value_transactions::operator()); ; - class_< subtotal_transactions > - ("SubtotalTransactions", init *>() + class_< subtotal_transactions, bases > + ("SubtotalTransactions", init() [with_custodian_and_ward<1, 2>()]) .def("flush", subtotal_transactions_flush) .def("__call__", &subtotal_transactions::operator()); ; -#if 0 - class_< interval_transactions > - ("IntervalTransactions", init *>() + class_< interval_transactions, bases > + ("IntervalTransactions", init() [with_custodian_and_ward<1, 2>()]) - .def("flush", &item_handler::flush) + .def("flush", &xact_handler_t::flush) .def("__call__", &interval_transactions::operator()); ; -#endif - class_< dow_transactions > - ("DowTransactions", init *>() + class_< dow_transactions, bases > + ("DowTransactions", init() [with_custodian_and_ward<1, 2>()]) .def("flush", &dow_transactions::flush) .def("__call__", &dow_transactions::operator()); ; - class_< related_transactions > - ("RelatedTransactions", - init *, optional >() + class_< related_transactions, bases > + ("RelatedTransactions", init >() [with_custodian_and_ward<1, 2>()]) - .def("flush", &item_handler::flush) + .def("flush", &xact_handler_t::flush) .def("__call__", &related_transactions::operator()); ; -- cgit v1.2.3