summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-11 07:13:49 +0000
committerDana Jansens <danakj@orodu.net>2003-01-11 07:13:49 +0000
commit19bfac5195a1917f4a0bbcf910e90d5b800c5146 (patch)
treeb3d03af6230e70b0a7fb7b47d1fe766c289334ad /src
parent1c70394ce2d42c3e468116168be2cadb14687604 (diff)
broken to all hell. oh no.
Diffstat (limited to 'src')
-rw-r--r--src/python.cc27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/python.cc b/src/python.cc
index 040d7020..2c71b018 100644
--- a/src/python.cc
+++ b/src/python.cc
@@ -19,17 +19,28 @@ static PyObject *obdict = NULL;
void python_init(char *argv0)
{
+ std::string path;
+
// start the python engine
- Py_SetProgramName(argv0);
- Py_Initialize();
+ //Py_SetProgramName(argv0);
+ //Py_Initialize();
// initialize the C python module
- init_openbox();
+ //init_openbox();
// include the openbox directories for python scripts in the sys path
- 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("import sys");
+printf("SCRIPTDIR=%s\n", SCRIPTDIR);
+printf("1 getenv(DISPLAY)=%s\n", getenv("DISPLAY"));
+ path = "sys.path";
+printf("2 getenv(DISPLAY)=%s\n", getenv("DISPLAY"));
+ path = "sys.path.append('";
+printf("3 getenv(DISPLAY)=%s\n", getenv("DISPLAY"));
+ path += SCRIPTDIR;
+ path += "')";
+ PyRun_SimpleString(const_cast<char*>(path.c_str()));
+ path = "sys.path.append('";
+ path += otk::expandTilde("~/.openbox/python");
+ path += "')";
+ PyRun_SimpleString(const_cast<char*>(path.c_str()));
// import the otk and openbox modules into the main namespace
PyRun_SimpleString("from openbox import *;");
// set up convenience global variables