summaryrefslogtreecommitdiff
path: root/src/pyinterp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/pyinterp.cc')
-rw-r--r--src/pyinterp.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pyinterp.cc b/src/pyinterp.cc
index e15ff503..9d6638fc 100644
--- a/src/pyinterp.cc
+++ b/src/pyinterp.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2013, John Wiegley. All rights reserved.
+ * Copyright (c) 2003-2014, John Wiegley. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -34,6 +34,7 @@
#include "pyinterp.h"
#include "pyutils.h"
#include "account.h"
+#include "report.h"
#include "xact.h"
#include "post.h"
@@ -76,6 +77,12 @@ void initialize_for_python()
export_xact();
export_session();
export_journal();
+
+ if (! scope_t::default_scope) {
+ 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