pythonsecurity.cpp
93 throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to initialize PythonSecurity module: %1").arg(err) ) );
107PyObject* PythonSecurity::compile_restricted(const TQString& source, const TQString& filename, const TQString& mode)
118 throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("No such function '%1'.").arg("compile_restricted")) );
123 throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Function '%1' is not callable.").arg("compile_restricted")) );
144 //krossdebug( TQString("dir().dir() = %1").arg( Py::Object(ml[mi]).dir().as_string().c_str() ) );
149 krossdebug( TQString("%1 callable=%2").arg(code.as_string().c_str()).arg(PyCallable_Check(code.ptr())) );
161 throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Function '%1' failed with python exception: %2").arg("compile_restricted").arg(err) ) );
166void PythonSecurity::compile_restricted_function(const Py::Tuple& /*args*/, const TQString& /*body*/, const TQString& /*name*/, const TQString& /*filename*/, const Py::Object& /*globalize*/)
171void PythonSecurity::compile_restricted_exec(const TQString& /*source*/, const TQString& /*filename*/)
176void PythonSecurity::compile_restricted_eval(const TQString& /*source*/, const TQString& /*filename*/)
Common exception class used for representing exceptions in Kross.
Definition exception.h:39
TDESharedPtr< Exception > Ptr
Shared pointer to implement reference-counting.
Definition exception.h:45
This class handles the used Zope3 RestrictedPython package to spend a restricted sandbox for scriptin...
Definition pythonsecurity.h:57
PyObject * compile_restricted(const TQString &source, const TQString &filename, const TQString &mode)
Compile python scripting code and return a restricted code object.
Definition pythonsecurity.cpp:107
