]> Dogcows Code - chaz/openbox/blobdiff - src/python.cc
stop including otk in the openbox module. makes the wm hooger for no good cause....
[chaz/openbox] / src / python.cc
index 2e490d314e34d74e7e891001431b40819fbb40e1..9ea93b4d5b5c7d61d26fa4533c41ca9bc169edd6 100644 (file)
@@ -6,6 +6,7 @@
 #include "python.hh"
 #include "bindings.hh"
 #include "otk/display.hh"
+#include "otk/util.hh"
 
 extern "C" {
 // The initializer in openbox_wrap.cc
@@ -24,7 +25,13 @@ void python_init(char *argv0)
   Py_Initialize();
   init_otk();
   init_openbox();
-  PyRun_SimpleString("from _otk import *; from _openbox import *;");
+  PyRun_SimpleString("import sys");
+  PyRun_SimpleString("sys.path.append('" SCRIPTDIR "')");
+  PyRun_SimpleString(const_cast<char*>(((std::string)"sys.path.append('" +
+                                        otk::expandTilde("~/.openbox/python") +
+                                        "')").c_str()));
+//  PyRun_SimpleString("from _otk import *; from _openbox import *;");
+  PyRun_SimpleString("from otk import *; from openbox import *;");
   PyRun_SimpleString("openbox = Openbox_instance()");
   PyRun_SimpleString("display = OBDisplay_display()");
 
@@ -143,6 +150,7 @@ PyObject *kbind(PyObject *keylist, ob::KeyContext context, PyObject *func)
     vectkeylist.push_back(PyString_AsString(str));
   }
 
+  (void)context; // XXX use this sometime!
   if (!ob::Openbox::instance->bindings()->addKey(vectkeylist, func)) {
     PyErr_SetString(PyExc_RuntimeError,"Unable to add binding.");
     return NULL;
This page took 0.020912 seconds and 4 git commands to generate.