diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-05 02:22:17 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-05 02:22:17 -0500 |
commit | 40a430139edd12d9f580f5616571bc3ed8709d73 (patch) | |
tree | 8779adff41b86aaaa4137673823c4d621611bb9d /src/py_journal.cc | |
parent | 111881f3cea1266206c7ea6382e44d70ed71f37a (diff) | |
download | fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.tar.gz fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.tar.bz2 fork-ledger-40a430139edd12d9f580f5616571bc3ed8709d73.zip |
Transactions, etc., are now accessed by iterators
Diffstat (limited to 'src/py_journal.cc')
-rw-r--r-- | src/py_journal.cc | 12 |
1 files changed, 11 insertions, 1 deletions
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<return_internal_reference<> > + (&journal_t::xacts_begin, &journal_t::xacts_end)) + .def("xacts", range<return_internal_reference<> > + (&journal_t::xacts_begin, &journal_t::xacts_end)) + .def("auto_xacts", range<return_internal_reference<> > + (&journal_t::auto_xacts_begin, &journal_t::auto_xacts_end)) + .def("period_xacts", range<return_internal_reference<> > + (&journal_t::period_xacts_begin, &journal_t::period_xacts_end)) + .def("sources", range<return_internal_reference<> > + (&journal_t::sources_begin, &journal_t::sources_end)) + .def("valid", &journal_t::valid) ; } |