summaryrefslogtreecommitdiffstats
path: root/lib/kross/python/pythoninterpreter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kross/python/pythoninterpreter.cpp')
-rw-r--r--lib/kross/python/pythoninterpreter.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/lib/kross/python/pythoninterpreter.cpp b/lib/kross/python/pythoninterpreter.cpp
index 92f627dd..23f4b8fb 100644
--- a/lib/kross/python/pythoninterpreter.cpp
+++ b/lib/kross/python/pythoninterpreter.cpp
@@ -27,7 +27,7 @@
#include <kglobal.h>
#include <kstandarddirs.h>
-#if defined(Q_WS_WIN)
+#if defined(TQ_WS_WIN)
#define PYPATHDELIMITER ";"
#else
#define PYPATHDELIMITER ":"
@@ -93,10 +93,10 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
// In the python sys.path are all module-directories are
// listed in.
- QString path;
+ TQString path;
// First import the sys-module to remember it's sys.path
- // list in our path QString.
+ // list in our path TQString.
Py::Module sysmod( PyImport_ImportModule("sys"), true );
Py::Dict sysmoddict = sysmod.getDict();
Py::Object syspath = sysmoddict.getItem("path");
@@ -104,32 +104,32 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
Py::List syspathlist = syspath;
for(Py::List::iterator it = syspathlist.begin(); it != syspathlist.end(); ++it)
if( (*it).isString() )
- path.append( QString(Py::String(*it).as_string().c_str()) + PYPATHDELIMITER );
+ path.append( TQString(Py::String(*it).as_string().c_str()) + PYPATHDELIMITER );
}
else
path = Py_GetPath();
// Determinate additional module-paths we like to add.
// First add the global Kross modules-path.
- QStringList krossdirs = KGlobal::dirs()->findDirs("data", "kross/python");
- for(QStringList::Iterator krossit = krossdirs.begin(); krossit != krossdirs.end(); ++krossit)
+ TQStringList krossdirs = KGlobal::dirs()->findDirs("data", "kross/python");
+ for(TQStringList::Iterator krossit = krossdirs.begin(); krossit != krossdirs.end(); ++krossit)
path.append(*krossit + PYPATHDELIMITER);
// Then add the application modules-path.
- QStringList appdirs = KGlobal::dirs()->findDirs("appdata", "kross/python");
- for(QStringList::Iterator appit = appdirs.begin(); appit != appdirs.end(); ++appit)
+ TQStringList appdirs = KGlobal::dirs()->findDirs("appdata", "kross/python");
+ for(TQStringList::Iterator appit = appdirs.begin(); appit != appdirs.end(); ++appit)
path.append(*appit + PYPATHDELIMITER);
// Set the extended sys.path.
PySys_SetPath( (char*) path.latin1() );
- krossdebug(QString("Python ProgramName: %1").arg(Py_GetProgramName()));
- krossdebug(QString("Python ProgramFullPath: %1").arg(Py_GetProgramFullPath()));
- krossdebug(QString("Python Version: %1").arg(Py_GetVersion()));
- krossdebug(QString("Python Platform: %1").arg(Py_GetPlatform()));
- krossdebug(QString("Python Prefix: %1").arg(Py_GetPrefix()));
- krossdebug(QString("Python ExecPrefix: %1").arg(Py_GetExecPrefix()));
- krossdebug(QString("Python Path: %1").arg(Py_GetPath()));
- krossdebug(QString("Python System Path: %1").arg(path));
+ krossdebug(TQString("Python ProgramName: %1").tqarg(Py_GetProgramName()));
+ krossdebug(TQString("Python ProgramFullPath: %1").tqarg(Py_GetProgramFullPath()));
+ krossdebug(TQString("Python Version: %1").tqarg(Py_GetVersion()));
+ krossdebug(TQString("Python Platform: %1").tqarg(Py_GetPlatform()));
+ krossdebug(TQString("Python Prefix: %1").tqarg(Py_GetPrefix()));
+ krossdebug(TQString("Python ExecPrefix: %1").tqarg(Py_GetExecPrefix()));
+ krossdebug(TQString("Python Path: %1").tqarg(Py_GetPath()));
+ krossdebug(TQString("Python System Path: %1").tqarg(path));
// Initialize the main module.
d->mainmodule = new PythonModule(this);
@@ -139,7 +139,7 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
//TODO moduledict["KrossPythonVersion"] = Py::Int(KROSS_PYTHON_VERSION);
// Prepare the interpreter.
- QString s =
+ TQString s =
"import sys\n"
//"sys.setdefaultencoding('latin-1')\n"
@@ -179,7 +179,7 @@ PythonInterpreter::PythonInterpreter(Kross::Api::InterpreterInfo* info)
PyObject* pyrun = PyRun_String(s.latin1(), Py_file_input, moduledict.ptr(), moduledict.ptr());
if(! pyrun) {
Py::Object errobj = Py::value(Py::Exception()); // get last error
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to prepare the __main__ module: %1").arg(errobj.as_string().c_str())) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to prepare the __main__ module: %1").tqarg(errobj.as_string().c_str())) );
}
Py_XDECREF(pyrun); // free the reference.