summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2018-01-23 00:36:24 -0800
committerGitHub <noreply@github.com>2018-01-23 00:36:24 -0800
commitb3b72cbea23a69bcbf7a30ca34471c72c07370e4 (patch)
treef6b443e15b91bdd14604f18211059ab0bdbb16d6
parent699b2fc32c05871032adb6c6b3be489aef6e8720 (diff)
parent0e740b5f42a4c29639984fb85df0fca5d0e1f7dc (diff)
downloadfork-ledger-b3b72cbea23a69bcbf7a30ca34471c72c07370e4.tar.gz
fork-ledger-b3b72cbea23a69bcbf7a30ca34471c72c07370e4.tar.bz2
fork-ledger-b3b72cbea23a69bcbf7a30ca34471c72c07370e4.zip
Merge pull request #511 from kylef/kylef/register_account
Expose journal_t::register_account to Python
-rw-r--r--src/py_journal.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/py_journal.cc b/src/py_journal.cc
index fbc6dd2d..51ff20c2 100644
--- a/src/py_journal.cc
+++ b/src/py_journal.cc
@@ -135,6 +135,11 @@ namespace {
return journal.find_account(name, auto_create);
}
+ account_t * py_register_account(journal_t& journal, const string& name, post_t* post)
+ {
+ return journal.register_account(name, post, journal.master);
+ }
+
#if 0
std::size_t py_read(journal_t& journal, const string& pathname)
{
@@ -286,6 +291,10 @@ void export_journal()
return_internal_reference<1,
with_custodian_and_ward_postcall<1, 0> >())
+ .def("register_account", py_register_account,
+ return_internal_reference<1,
+ with_custodian_and_ward_postcall<1, 0> >())
+
.def("expand_aliases", &journal_t::expand_aliases,
return_internal_reference<1,
with_custodian_and_ward_postcall<1, 0> >())