diff options
author | John Wiegley <johnw@newartisans.com> | 2004-09-14 05:14:58 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2004-09-14 05:14:58 -0400 |
commit | 0b0c9b5bd13b1dedf100b137e3a35be60d3d3a27 (patch) | |
tree | a021447b83f7aff6c0072124a53b330242b55539 /python.cc | |
parent | bd72c0cf908492abb99a1419f7f8136729747061 (diff) | |
download | fork-ledger-0b0c9b5bd13b1dedf100b137e3a35be60d3d3a27.tar.gz fork-ledger-0b0c9b5bd13b1dedf100b137e3a35be60d3d3a27.tar.bz2 fork-ledger-0b0c9b5bd13b1dedf100b137e3a35be60d3d3a27.zip |
ledger.so can now call back to functions in the calling interpretor (see main.py)
Diffstat (limited to 'python.cc')
-rw-r--r-- | python.cc | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -27,6 +27,8 @@ namespace ledger { python_support * python_interpretor = NULL; +#ifndef PYTHON_MODULE + static struct cleanup_python { ~cleanup_python() { if (python_interpretor) { @@ -56,14 +58,18 @@ void init_module() export_datetime(); } +#endif // PYTHON_MODULE + void init_python() { assert(! python_interpretor); +#ifndef PYTHON_MODULE Py_Initialize(); - python_interpretor = new python_support; - detail::init_module("ledger", &init_module); +#endif + + python_interpretor = new python_support; } } // namespace ledger |