lib
pythonsecurity.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KROSS_PYTHON_SECURITY_H
00021 #define KROSS_PYTHON_SECURITY_H
00022
00023 #include "pythonconfig.h"
00024
00025 #include <qstring.h>
00026
00027 namespace Kross { namespace Python {
00028
00029
00030 class PythonInterpreter;
00031
00056 class PythonSecurity : public Py::ExtensionModule<PythonSecurity>
00057 {
00058 public:
00059
00066 explicit PythonSecurity(PythonInterpreter* interpreter);
00067
00071 virtual ~PythonSecurity();
00072
00085 PyObject* compile_restricted(const QString& source, const QString& filename, const QString& mode);
00086
00087 #if 0
00088
00089 void compile_restricted_function(const Py::Tuple& args, const QString& body, const QString& name, const QString& filename, const Py::Object& globalize = Py::None());
00090 void compile_restricted_exec(const QString& source, const QString& filename = "<string>");
00091 void compile_restricted_eval(const QString& source, const QString& filename = "<string>");
00092 #endif
00093
00094 private:
00096 PythonInterpreter* m_interpreter;
00098 Py::Module* m_pymodule;
00099
00101 inline void initRestrictedPython();
00102
00104 Py::Object _getattr_(const Py::Tuple&);
00105 };
00106
00107 }}
00108
00109 #endif
|