summaryrefslogtreecommitdiff
path: root/src/py_journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 02:22:17 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 02:22:17 -0500
commit40a430139edd12d9f580f5616571bc3ed8709d73 (patch)
tree8779adff41b86aaaa4137673823c4d621611bb9d /src/py_journal.cc
parent111881f3cea1266206c7ea6382e44d70ed71f37a (diff)
downloadfork-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.cc12
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)
;
}