From 6b50c85f0133f89c581a4c3041f9653a71ebace5 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 15 Feb 2005 10:28:28 +0000 Subject: Expose FormatEmacsTransactions to Python. --- emacs.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/emacs.cc b/emacs.cc index 8a4d7f84..27b44de6 100644 --- a/emacs.cc +++ b/emacs.cc @@ -57,3 +57,26 @@ void format_emacs_transactions::operator()(transaction_t& xact) } } // namespace ledger + +#ifdef USE_BOOST_PYTHON + +#include + +using namespace boost::python; +using namespace ledger; + +void export_emacs() +{ + typedef + pystream_handler_wrap + format_emacs_transactions_wrap; + + class_< format_emacs_transactions_wrap, bases > > + ("FormatEmacsTransactions", + init()[with_custodian_and_ward<1, 2>()]) + .def("flush", &format_emacs_transactions_wrap::flush) + .def("__call__", &format_emacs_transactions_wrap::operator()) + ; +} + +#endif // USE_BOOST_PYTHON -- cgit v1.2.3