From 40a430139edd12d9f580f5616571bc3ed8709d73 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 5 Nov 2009 02:22:17 -0500 Subject: Transactions, etc., are now accessed by iterators --- src/py_journal.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/py_journal.cc') diff --git a/src/py_journal.cc b/src/py_journal.cc index 873645d3..0f800077 100644 --- a/src/py_journal.cc +++ b/src/py_journal.cc @@ -192,7 +192,6 @@ void export_journal() make_getter(&journal_t::basket, return_internal_reference<1>()), make_setter(&journal_t::basket)) - .add_property("sources", make_getter(&journal_t::sources)) .add_property("was_loaded", make_getter(&journal_t::was_loaded)) .add_property("commodity_pool", make_getter(&journal_t::commodity_pool, @@ -221,6 +220,17 @@ void export_journal() .def("__len__", xacts_len) .def("__getitem__", xacts_getitem, return_internal_reference<1>()) + .def("__iter__", range > + (&journal_t::xacts_begin, &journal_t::xacts_end)) + .def("xacts", range > + (&journal_t::xacts_begin, &journal_t::xacts_end)) + .def("auto_xacts", range > + (&journal_t::auto_xacts_begin, &journal_t::auto_xacts_end)) + .def("period_xacts", range > + (&journal_t::period_xacts_begin, &journal_t::period_xacts_end)) + .def("sources", range > + (&journal_t::sources_begin, &journal_t::sources_end)) + .def("valid", &journal_t::valid) ; } -- cgit v1.2.3