|
Blender V4.3
|
#include <Python.h>#include "BLI_listbase.h"#include "BLI_utildefines.h"#include "bpy_capi_utils.hh"#include "MEM_guardedalloc.h"#include "BKE_report.hh"#include "../generic/py_capi_utils.hh"Go to the source code of this file.
Functions | |
| short | BPy_reports_to_error (ReportList *reports, PyObject *exception, const bool clear) |
| void | BPy_reports_write_stdout (const ReportList *reports, const char *header) |
| bool | BPy_errors_to_report_ex (ReportList *reports, const char *error_prefix, const bool use_full, const bool use_location) |
| bool | BPy_errors_to_report (ReportList *reports) |
This file contains Blender/Python utility functions to help implementing API's. This is not related to a particular module.
Definition in file bpy_capi_utils.cc.
| bool BPy_errors_to_report | ( | struct ReportList * | reports | ) |
| reports | Any errors will be added to the report list. |
stdout/stderr, so you may wish to call either BKE_reports_print(reports) or PyErr_Print() afterwards. Typically PyErr_Print() is preferable as sys.excepthook is called.Definition at line 137 of file bpy_capi_utils.cc.
References BPy_errors_to_report_ex().
Referenced by bpy_class_call(), bpy_run_string_impl(), and python_script_exec().
| bool BPy_errors_to_report_ex | ( | ReportList * | reports, |
| const char * | error_prefix, | ||
| const bool | use_full, | ||
| const bool | use_location ) |
Definition at line 68 of file bpy_capi_utils.cc.
References BKE_reportf(), BKE_reports_free(), BKE_reports_init(), BKE_reports_move_to_reports(), ReportList::flag, PyC_ExceptionBuffer(), PyC_ExceptionBuffer_Simple(), PyC_FileAndNum(), RPT_ERROR, RPT_PRINT_HANDLED_BY_OWNER, and ReportList::storelevel.
Referenced by BPy_errors_to_report().
| short BPy_reports_to_error | ( | struct ReportList * | reports, |
| PyObject * | exception, | ||
| bool | clear ) |
Error reporting: convert BKE_report (ReportList) reports into python errors.
| clear | When true, BKE_reports_free is called on the given reports, which should then be considered as 'freed' data and not used anymore. |
Definition at line 25 of file bpy_capi_utils.cc.
References BKE_reports_free(), BKE_reports_string(), clear(), MEM_freeN(), and RPT_ERROR.
Referenced by bpy_lib_enter(), bpy_lib_write(), pyop_call(), pyrna_func_call(), pyrna_py_to_prop(), pyrna_register_class(), pyrna_struct_driver_add(), pyrna_struct_driver_remove(), pyrna_struct_keyframe_delete(), and pyrna_struct_keyframe_insert().
| void BPy_reports_write_stdout | ( | const ReportList * | reports, |
| const char * | header ) |
Definition at line 43 of file bpy_capi_utils.cc.
References ListBase::first, ReportList::list, Report::message, Report::next, ReportList::printlevel, Report::type, and Report::typestr.
Referenced by pyop_call(), pyrna_register_class(), and pyrna_struct_keyframe_insert().