summaryrefslogtreecommitdiffstats
path: root/lib/kross/python/pythonscript.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kross/python/pythonscript.cpp')
-rw-r--r--lib/kross/python/pythonscript.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/kross/python/pythonscript.cpp b/lib/kross/python/pythonscript.cpp
index 8887e13d..2329a1d1 100644
--- a/lib/kross/python/pythonscript.cpp
+++ b/lib/kross/python/pythonscript.cpp
@@ -88,7 +88,7 @@ void PythonScript::initialize()
try {
if(m_scriptcontainer->getCode().isNull())
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid scripting code for script '%1'").arg( m_scriptcontainer->getName() )) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid scripting code for script '%1'").tqarg( m_scriptcontainer->getName() )) );
if(m_scriptcontainer->getName().isNull())
throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Name for the script is invalid!")) );
@@ -96,10 +96,10 @@ void PythonScript::initialize()
PyObject* pymod = PyModule_New( (char*) m_scriptcontainer->getName().latin1() );
d->m_module = new Py::Module(pymod, true);
if(! d->m_module)
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to initialize local module context for script '%1'").arg( m_scriptcontainer->getName() )) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to initialize local module context for script '%1'").tqarg( m_scriptcontainer->getName() )) );
#ifdef KROSS_PYTHON_SCRIPT_INIT_DEBUG
- krossdebug( TQString("PythonScript::initialize() module='%1' refcount='%2'").arg(d->m_module->as_string().c_str()).arg(d->m_module->reference_count()) );
+ krossdebug( TQString("PythonScript::initialize() module='%1' refcount='%2'").tqarg(d->m_module->as_string().c_str()).tqarg(d->m_module->reference_count()) );
#endif
// Set the "self" variable to point to the ScriptContainer
@@ -131,7 +131,7 @@ void PythonScript::initialize()
PyObject* code = 0;
bool restricted = m_scriptcontainer->getOption("restricted", TQVariant(false,0), true).toBool();
- krossdebug( TQString("PythonScript::initialize() name=%1 restricted=%2").arg(m_scriptcontainer->getName()).arg(restricted) );
+ krossdebug( TQString("PythonScript::initialize() name=%1 restricted=%2").tqarg(m_scriptcontainer->getName()).tqarg(restricted) );
if(restricted) {
// Use the RestrictedPython module wrapped by the PythonSecurity class.
@@ -160,7 +160,7 @@ void PythonScript::initialize()
}
catch(Py::Exception& e) {
TQString err = Py::value(e).as_string().c_str();
- Kross::Api::Exception::Ptr exception = toException( TQString("Failed to compile python code: %1").arg(err) );
+ Kross::Api::Exception::Ptr exception = toException( TQString("Failed to compile python code: %1").tqarg(err) );
e.clear(); // exception is handled. clear it now.
throw exception;
}
@@ -170,7 +170,7 @@ void PythonScript::finalize()
{
#ifdef KROSS_PYTHON_SCRIPT_FINALIZE_DEBUG
if(d->m_module)
- krossdebug( TQString("PythonScript::finalize() module='%1' refcount='%2'").arg(d->m_module->as_string().c_str()).arg(d->m_module->reference_count()) );
+ krossdebug( TQString("PythonScript::finalize() module='%1' refcount='%2'").tqarg(d->m_module->as_string().c_str()).tqarg(d->m_module->reference_count()) );
#endif
delete d->m_module; d->m_module = 0;
@@ -205,7 +205,7 @@ Kross::Api::Exception::Ptr PythonScript::toException(const TQString& error)
catch(Py::Exception& e) {
TQString err = Py::value(e).as_string().c_str();
e.clear(); // exception is handled. clear it now.
- krosswarning( TQString("Kross::Python::PythonScript::toException() Failed to fetch a traceback: %1").arg(err) );
+ krosswarning( TQString("Kross::Python::PythonScript::toException() Failed to fetch a traceback: %1").tqarg(err) );
}
PyObject *next;
@@ -226,7 +226,7 @@ Kross::Api::Exception::Ptr PythonScript::toException(const TQString& error)
//const char* filename = PyString_AsString(frame->f_code->co_filename);
//const char* name = PyString_AsString(frame->f_code->co_name);
- //errorlist.append( TQString("%1#%2: \"%3\"").arg(filename).arg(lineno).arg(name) );
+ //errorlist.append( TQString("%1#%2: \"%3\"").tqarg(filename).tqarg(lineno).tqarg(name) );
next = PyObject_GetAttrString(traceback, "tb_next");
Py_DECREF(traceback);
@@ -318,20 +318,20 @@ Kross::Api::Object::Ptr PythonScript::execute()
Py::Object result(pyresult, true);
#ifdef KROSS_PYTHON_SCRIPT_EXEC_DEBUG
- krossdebug( TQString("PythonScript::execute() result=%1").arg(result.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::execute() result=%1").tqarg(result.as_string().c_str()) );
#endif
for(Py::Dict::iterator it = moduledict.begin(); it != moduledict.end(); ++it) {
Py::Dict::value_type vt(*it);
if(PyClass_Check( vt.second.ptr() )) {
#ifdef KROSS_PYTHON_SCRIPT_EXEC_DEBUG
- krossdebug( TQString("PythonScript::execute() class '%1' added.").arg(vt.first.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::execute() class '%1' added.").tqarg(vt.first.as_string().c_str()) );
#endif
d->m_classes.append( vt.first.as_string().c_str() );
}
else if(vt.second.isCallable()) {
#ifdef KROSS_PYTHON_SCRIPT_EXEC_DEBUG
- krossdebug( TQString("PythonScript::execute() function '%1' added.").arg(vt.first.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::execute() function '%1' added.").tqarg(vt.first.as_string().c_str()) );
#endif
d->m_functions.append( vt.first.as_string().c_str() );
}
@@ -347,13 +347,13 @@ Kross::Api::Object::Ptr PythonScript::execute()
errobj = Py::type(e);
TQString err = errobj.as_string().c_str();
- Kross::Api::Exception::Ptr exception = toException( TQString("Failed to execute python code: %1").arg(err) );
+ Kross::Api::Exception::Ptr exception = toException( TQString("Failed to execute python code: %1").tqarg(err) );
e.clear(); // exception is handled. clear it now.
setException( exception );
}
catch(Py::Exception& e) {
TQString err = Py::value(e).as_string().c_str();
- Kross::Api::Exception::Ptr exception = toException( TQString("Failed to execute python code: %1").arg(err) );
+ Kross::Api::Exception::Ptr exception = toException( TQString("Failed to execute python code: %1").tqarg(err) );
e.clear(); // exception is handled. clear it now.
setException( exception );
}
@@ -369,8 +369,8 @@ Kross::Api::Object::Ptr PythonScript::callFunction(const TQString& name, Kross::
{
#ifdef KROSS_PYTHON_SCRIPT_CALLFUNC_DEBUG
krossdebug( TQString("PythonScript::callFunction(%1, %2)")
- .arg(name)
- .arg(args ? TQString::number(args->count()) : TQString("NULL")) );
+ .tqarg(name)
+ .tqarg(args ? TQString::number(args->count()) : TQString("NULL")) );
#endif
if(hadException()) return 0; // abort if we had an unresolved exception.
@@ -387,7 +387,7 @@ Kross::Api::Object::Ptr PythonScript::callFunction(const TQString& name, Kross::
PyObject* func = PyDict_GetItemString(moduledict.ptr(), name.latin1());
if( (! d->m_functions.contains(name)) || (! func) )
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such function '%1'.").arg(name)) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such function '%1'.").tqarg(name)) );
Py::Callable funcobject(func, true); // the funcobject takes care of freeing our func pyobject.
@@ -402,7 +402,7 @@ Kross::Api::Object::Ptr PythonScript::callFunction(const TQString& name, Kross::
catch(Py::Exception& e) {
TQString err = Py::value(e).as_string().c_str();
e.clear(); // exception is handled. clear it now.
- setException( new Kross::Api::Exception(TQString("Python Exception: %1").arg(err)) );
+ setException( new Kross::Api::Exception(TQString("Python Exception: %1").tqarg(err)) );
}
catch(Kross::Api::Exception::Ptr e) {
setException(e);
@@ -433,16 +433,16 @@ Kross::Api::Object::Ptr PythonScript::classInstance(const TQString& name)
// Try to determinate the class.
PyObject* pyclass = PyDict_GetItemString(moduledict.ptr(), name.latin1());
if( (! d->m_classes.contains(name)) || (! pyclass) )
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such class '%1'.").arg(name)) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such class '%1'.").tqarg(name)) );
PyObject *pyobj = PyInstance_New(pyclass, 0, 0);//aclarg, 0);
if(! pyobj)
- throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to create instance of class '%1'.").arg(name)) );
+ throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to create instance of class '%1'.").tqarg(name)) );
Py::Object classobject(pyobj, true);
#ifdef KROSS_PYTHON_SCRIPT_CLASSINSTANCE_DEBUG
- krossdebug( TQString("PythonScript::classInstance() inst='%1'").arg(classobject.as_string().c_str()) );
+ krossdebug( TQString("PythonScript::classInstance() inst='%1'").tqarg(classobject.as_string().c_str()) );
#endif
return PythonExtension::toObject(classobject);
}