10 #ifndef __PY_Python_h__
11 #define __PY_Python_h__
30 virtual void onNotifyPYResult(
PY_Result const &
result,
const char* user_data) = 0;
49 const char *python_code,
51 const char *heading = NULL,
60 const char *python_code,
63 const char *error_heading,
64 const char *error_for_wrong_type,
76 const char *python_code,
78 const char *as_file=
nullptr);
80 const char *python_code,
const char *as_file=
nullptr);
86 const char *python_code,
87 int argc,
char *argv[],
89 bool update_path=
true);
99 const char *python_code,
100 const char *heading = NULL,
102 const char *as_file=
nullptr);
104 const char *python_code,
105 const char *heading = NULL,
106 const char *as_file=
nullptr);
116 int argc,
char *argv[],
118 bool update_path=
true);
127 const char *python_code,
UT_String &errors);
129 const char *file_name,
UT_String &errors);
131 int argc,
char *argv[],
UT_String &errors,
bool update_path=
true);
156 void *opaque_python_object,
const char *method_name,
176 const char *module_name,
const char *module_contents);
190 void (*callback)(
const char *heading,
const char *error_message));
195 const char *heading,
const char *traceback_message);
260 template<
typename FUNC>
265 FUNC
const& process_func )
274 process_func(errmsg.c_str());
PY_API void PYsetAutoInitializeFromPython(bool auto_initialize)
PY_API PY_Result PYextractResultFromPythonObject(void *opaque_python_object, PY_Result::Type desired_result_type)
GT_API const UT_StringHolder filename
PY_API PY_Result PYrunPythonStatementsFromFile(const char *filename, PY_EvaluationContext *context=NULL)
PY_API void PYlogError(PY_Result const &result, const char *title)
PY_API void PYdisplayPythonTraceback(const char *heading, const char *traceback_message)
PY_API bool PYautoInitializeFromPython()
PY_API void * PYgetCodeObjectForFunction(void *opaque_python_object)
Return a PyCodeObject * corresponding to the specified PyObject.
PY_API UT_UniquePtr< UT_Thread > PYrunPythonStatementsFromFileInNewThread(const char *file_name, UT_String &errors)
PY_API PY_Result PYcallMethodOnPythonObject(void *opaque_python_object, const char *method_name, PY_Result::Type desired_result_type)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
PY_API bool PYrunPythonExpressionOfExactType(const char *python_code, PY_Result::Type desired_result_type, PY_Result &result, const char *error_heading, const char *error_for_wrong_type, PY_EvaluationContext *context=NULL)
PY_API PY_Result PYrunPythonStatementsInNewContext(const char *python_code, const char *as_file=nullptr)
PY_API bool PYrunPythonStatementsAndExpectNoErrors(const char *python_code, const char *heading=NULL, PY_EvaluationContext *context=NULL, const char *as_file=nullptr)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
PY_API PY_Result PYrunPythonExpressionAndExpectNoErrors(const char *python_code, PY_Result::Type desired_result_type, const char *heading=NULL, PY_EvaluationContext *context=NULL)
PY_API void PYnotifyResultClients(PY_Result const &result, char const *script_event)
PY_API void PYsetPythonTracebackDisplayCallback(void(*callback)(const char *heading, const char *error_message))
PY_API const char * PYgetErrorFormat()
void PYprocessError(PY_Result const &result, const char *title, const char *format, FUNC const &process_func)
PY_API UT_UniquePtr< UT_Thread > PYrunPythonStatementsInNewThread(const char *python_code, UT_String &errors)
PY_API void * PYcallObjectAndCatchCrashes(void *callable)
PY_API PY_Result PYbindFunctionFromModule(const char *module_name, const char *func_name)
PY_API PY_Result PYrunPythonExpressionInNewContext(const char *python_code, PY_Result::Type desired_result_type)
PY_API PY_EvaluationContext & PYgetPythonExpressionEvaluationContext()
PY_API PY_Result PYrunPythonStatements(const char *python_code, PY_EvaluationContext *context=NULL, const char *as_file=nullptr)
std::weak_ptr< T > UT_WeakPtr
PY_API PY_Result PYextractPythonException()
PY_API void PYregisterAtExitCallback(std::function< void(void)> func)
PY_API const char * PYgetHoudiniModulePath()
Returns the absolute path to Houdini's Python modules.
PY_API PY_Result PYimportModuleFromString(const char *module_name, const char *module_contents)
PY_API void PYregisterResultClient(UT_WeakPtr< PY_ResultClient > result_client)
Registers a client interested in Python script evaluation results.
PY_API void * PYgetCodeObjectForPrevFrame()
PY_API UT_StringHolder PYformatError(PY_Result const &result, const char *title, const char *format)
PY_API PY_Result PYrunPythonExpression(const char *python_code, PY_Result::Type desired_result_type, PY_EvaluationContext *context=NULL)
PY_API bool PYrunPythonStatementsInNewContextAndExpectNoErrors(const char *python_code, const char *heading=NULL, const char *as_file=nullptr)