summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-24 07:00:52 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-24 07:00:52 -0400
commit528019ce253fb8f0aff77516e3e900048257a00a (patch)
treef6ed4624b0c62a92d59b517b01718b042084768d /journal.cc
parentd110df6741d3732634beb287b94afd0dbff52b7b (diff)
downloadfork-ledger-528019ce253fb8f0aff77516e3e900048257a00a.tar.gz
fork-ledger-528019ce253fb8f0aff77516e3e900048257a00a.tar.bz2
fork-ledger-528019ce253fb8f0aff77516e3e900048257a00a.zip
added support for "equity" in main.py
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/journal.cc b/journal.cc
index 01740d13..a949d7a4 100644
--- a/journal.cc
+++ b/journal.cc
@@ -569,6 +569,16 @@ account_t * py_find_account_2(journal_t& journal, const std::string& name,
return journal.find_account(name, auto_create);
}
+PyObject * py_account_get_data(account_t& account)
+{
+ return (PyObject *) account.data;
+}
+
+void py_account_set_data(account_t& account, PyObject * obj)
+{
+ account.data = obj;
+}
+
struct py_entry_finalizer_t : public entry_finalizer_t {
object pyobj;
py_entry_finalizer_t() {}
@@ -656,7 +666,7 @@ void export_journal()
.def_readwrite("note", &account_t::note)
.def_readonly("depth", &account_t::depth)
.def_readonly("transactions", &account_t::transactions)
- .def_readwrite("data", &account_t::data)
+ .add_property("data", py_account_get_data, py_account_set_data)
.def_readonly("ident", &account_t::ident)
.def(self_ns::str(self))