Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_capi_utils.c
| Show All 18 Lines | |||||
| * | * | ||||
| * This file contains Blender/Python utility functions to help implementing API's. | * This file contains Blender/Python utility functions to help implementing API's. | ||||
| * This is not related to a particular module. | * This is not related to a particular module. | ||||
| */ | */ | ||||
| #include <Python.h> | #include <Python.h> | ||||
| #include "BLI_dynstr.h" | #include "BLI_dynstr.h" | ||||
| #include "BLI_listbase.h" | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "bpy_capi_utils.h" | #include "bpy_capi_utils.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| ▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | |||||
| * A version of #BKE_report_write_file_fp that uses Python's stdout. | * A version of #BKE_report_write_file_fp that uses Python's stdout. | ||||
| */ | */ | ||||
| void BPy_reports_write_stdout(const ReportList *reports, const char *header) | void BPy_reports_write_stdout(const ReportList *reports, const char *header) | ||||
| { | { | ||||
| if (header) { | if (header) { | ||||
| PySys_WriteStdout("%s\n", header); | PySys_WriteStdout("%s\n", header); | ||||
| } | } | ||||
| for (const Report *report = reports->list.first; report; report = report->next) { | LISTBASE_FOREACH (const Report *, report, &reports->list) { | ||||
| PySys_WriteStdout("%s: %s\n", report->typestr, report->message); | PySys_WriteStdout("%s: %s\n", report->typestr, report->message); | ||||
| } | } | ||||
| } | } | ||||
| bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const bool use_location) | bool BPy_errors_to_report_ex(ReportList *reports, const bool use_full, const bool use_location) | ||||
| { | { | ||||
| PyObject *pystring; | PyObject *pystring; | ||||
| ▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines | |||||