39 #include "../generic/py_capi_utils.h"
47 for (
bool is_first =
true; item->
identifier; item++) {
70 PyErr_SetString(exception, report_str);
74 return (report_str ==
NULL) ? 0 : -1;
83 PySys_WriteStdout(
"%s\n", header);
87 PySys_WriteStdout(
"%s: %s\n", report->typestr, report->message);
92 const char *error_prefix,
94 const bool use_location)
98 if (!PyErr_Occurred()) {
103 if (reports ==
NULL) {
116 if (pystring ==
NULL) {
121 if (error_prefix ==
NULL) {
123 error_prefix =
"Python";
127 const char *filename;
131 if (filename ==
NULL) {
132 filename =
"<unknown location>";
137 TIP_(
"%s: %s\nlocation: %s:%d\n"),
139 PyUnicode_AsUTF8(pystring),
145 TIP_(
"%s: %s\nlocation: %s:%d\n"),
147 PyUnicode_AsUTF8(pystring),
void BKE_report(ReportList *reports, ReportType type, const char *message)
char * BKE_reports_string(ReportList *reports, ReportType level)
void BKE_reports_clear(ReportList *reports)
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
A dynamically sized string ADT.
DynStr * BLI_dynstr_new(void) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL()
void BLI_dynstr_appendf(DynStr *__restrict ds, const char *__restrict format,...) ATTR_PRINTF_FORMAT(2
char * BLI_dynstr_get_cstring(DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
#define LISTBASE_FOREACH(type, var, list)
Read Guarded memory(de)allocation.
char * BPy_enum_as_string(const EnumPropertyItem *item)
bool BPy_errors_to_report_ex(ReportList *reports, const char *error_prefix, const bool use_full, const bool use_location)
void BPy_reports_write_stdout(const ReportList *reports, const char *header)
short BPy_reports_to_error(ReportList *reports, PyObject *exception, const bool clear)
bool BPy_errors_to_report(ReportList *reports)
void(* MEM_freeN)(void *vmemh)
static void clear(Message *msg)
PyObject * PyC_ExceptionBuffer(void)
PyObject * PyC_ExceptionBuffer_Simple(void)
void PyC_FileAndNum(const char **r_filename, int *r_lineno)