-static PyMethodDef OBMethods[] = {
- {"shit", shit, METH_VARARGS,
- "Do some shit, yo!"},
-
- {"get_client_dict", get_client_dict, METH_VARARGS,
- "Get the list of all clients"},
-
- {NULL, NULL, 0, NULL}
-};
+void python_init(char *argv0)
+{
+ // start the python engine
+ Py_SetProgramName(argv0);
+ Py_Initialize();
+ // prepend the openbox directories for python scripts to the sys path
+ PyRun_SimpleString("import sys");
+ PyRun_SimpleString("sys.path.insert(0, '" SCRIPTDIR "')");
+ PyRun_SimpleString(const_cast<char*>(("sys.path.insert(0, '" +
+ otk::expandTilde("~/.openbox/python") +
+ "')").c_str()));
+}