diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-07-12 15:16:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-07-12 15:26:14 +0300 |
commit | 2fd3b9ad846621c8d3002fa561bd3fd6a972b8af (patch) | |
tree | 04bbbfd20ddc1e34f36d9ebf3e06e42c249e8f4e /source/blender/python | |
parent | 532b735ee8e2d38120deb6a847e5780f2a787224 (diff) |
PyAPI: Use separate writes for operator reports
This allows us to temp override the stdout and extract individual reports
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 8309938b632..fc17173a5d4 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -36,6 +36,7 @@ #include "RNA_types.h" #include "BLI_utildefines.h" +#include "BLI_listbase.h" #include "BLI_string.h" #include "BPY_extern.h" @@ -251,12 +252,10 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) error_val = BPy_reports_to_error(reports, PyExc_RuntimeError, false); /* operator output is nice to have in the terminal/console too */ - if (reports->list.first) { - char *report_str = BKE_reports_string(reports, 0); /* all reports */ - - if (report_str) { - PySys_WriteStdout("%s\n", report_str); - MEM_freeN(report_str); + if (!BLI_listbase_is_empty(&reports->list)) { + Report *report; + for (report = reports->list.first; report; report = report->next) { + PySys_WriteStdout("%s: %s\n", report->typestr, report->message); } } |