Create default scope to read journal

when using ledger python module
This commit is contained in:
Alexis Hildebrandt 2014-01-27 21:07:39 +01:00
parent 82486f6d43
commit a9078767b8

View file

@ -34,6 +34,7 @@
#include "pyinterp.h" #include "pyinterp.h"
#include "pyutils.h" #include "pyutils.h"
#include "account.h" #include "account.h"
#include "report.h"
#include "xact.h" #include "xact.h"
#include "post.h" #include "post.h"
@ -76,6 +77,10 @@ void initialize_for_python()
export_xact(); export_xact();
export_session(); export_session();
export_journal(); export_journal();
python_session.reset(new ledger::python_interpreter_t);
shared_ptr<session_t> session_ptr = python_session;
scope_t::default_scope = new report_t(*session_ptr);
} }
struct python_run struct python_run