summaryrefslogtreecommitdiff
path: root/src/python.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-27 13:42:41 +0000
committerDana Jansens <danakj@orodu.net>2003-01-27 13:42:41 +0000
commit5face4c6f35172761367f63ac0b6eaf62d84e532 (patch)
tree061851b68cc6e2d645b5966f76fa4ad0d300af92 /src/python.cc
parent5168a8add5ed46f74b615ecc60738c1113606734 (diff)
use otk objects in the ob scripts by importing otk
Diffstat (limited to 'src/python.cc')
-rw-r--r--src/python.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/python.cc b/src/python.cc
index f95d4723..a7e2eada 100644
--- a/src/python.cc
+++ b/src/python.cc
@@ -9,8 +9,9 @@
#include "otk/util.hh"
extern "C" {
-// The initializer in openbox_wrap.cc
+// The initializer in openbox_wrap.cc / otk_wrap.cc
extern void init_ob(void);
+extern void init_otk(void);
}
namespace ob {
@@ -23,6 +24,7 @@ void python_init(char *argv0)
Py_SetProgramName(argv0);
Py_Initialize();
// initialize the C python module
+ init_otk();
init_ob();
// include the openbox directories for python scripts in the sys path
PyRun_SimpleString("import sys");
@@ -30,10 +32,10 @@ void python_init(char *argv0)
otk::expandTilde("~/.openbox/python") +
"')").c_str()));
PyRun_SimpleString("sys.path.append('" SCRIPTDIR "')");
- PyRun_SimpleString("import ob;");
+ PyRun_SimpleString("import ob; import otk;");
// set up convenience global variables
PyRun_SimpleString("ob.openbox = ob.Openbox_instance()");
- PyRun_SimpleString("ob.display = ob.Display_instance()");
+ PyRun_SimpleString("otk.display = otk.Display_instance()");
// set up access to the python global variables
PyObject *obmodule = PyImport_AddModule("config");