X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fpython.cc;h=179e737264e9b0c2da1df04a95d8b029b5a1756f;hb=d22a6c6c04cf20bd23efa68ad1202f278f25e113;hp=874ad638b219215fc21089ba5b5304c085064a75;hpb=ff94208ce0f571139d12d61d8c6c1cadcb98e294;p=chaz%2Fopenbox diff --git a/src/python.cc b/src/python.cc index 874ad638..179e7372 100644 --- a/src/python.cc +++ b/src/python.cc @@ -32,7 +32,7 @@ void python_init(char *argv0) PyRun_SimpleString(const_cast(("sys.path.insert(0, '" + otk::expandTilde("~/.openbox/python") + "')").c_str())); - PyRun_SimpleString("import ob; import otk;");// import config;"); + PyRun_SimpleString("import ob; import otk; import config;"); // set up convenience global variables PyRun_SimpleString("ob.openbox = ob.Openbox_instance()"); PyRun_SimpleString("otk.display = otk.Display_instance()"); @@ -45,13 +45,14 @@ void python_init(char *argv0) void python_destroy() { Py_DECREF(obdict); + Py_Finalize(); } bool python_exec(const std::string &path) { FILE *rcpyfd = fopen(path.c_str(), "r"); if (!rcpyfd) { - printf("failed to load python file %s\n", path.c_str()); + printf("Failed to load python file %s\n", path.c_str()); return false; } PyRun_SimpleFile(rcpyfd, const_cast(path.c_str()));