Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-04-06 09:15:11 +0300
committerCampbell Barton <campbell@blender.org>2022-04-06 11:02:58 +0300
commit2d2baeaf04d481f284bc2f098fb6d7ee9268151f (patch)
treedee60d7075b6febe402323d5b12085bdff544630 /source/blender/blenkernel/BKE_report.h
parente4f71e5ef345070dc0b21df35a049184d3e46645 (diff)
Fix: T78228 Send all python errors to info editor
Python exceptions are now shown in the info editor, this also resolves an old bug where errors were printed twice. This was originally based on D9752 by @ShadowChaser although many changes have been made from the original patch. Details: - BPy_errors_to_report no longer prints additional output. - BKE_report_print_test was added so it's possible to check if calling BKE_report also printed to the stdout. - Callers to BPy_errors_to_report are responsible for ensuring output is printed to the stdout/stderr. - Python exceptions no longer add a trailing newline, needed to avoid blank-space when displayed in the info-editor.
Diffstat (limited to 'source/blender/blenkernel/BKE_report.h')
-rw-r--r--source/blender/blenkernel/BKE_report.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_report.h b/source/blender/blenkernel/BKE_report.h
index b67c4856e89..38b5c68c8ca 100644
--- a/source/blender/blenkernel/BKE_report.h
+++ b/source/blender/blenkernel/BKE_report.h
@@ -45,6 +45,11 @@ eReportType BKE_report_store_level(ReportList *reports);
void BKE_report_store_level_set(ReportList *reports, eReportType level);
char *BKE_reports_string(ReportList *reports, eReportType level);
+
+/**
+ * \return true when reports of this type will print to the `stdout`.
+ */
+bool BKE_reports_print_test(const ReportList *reports, eReportType type);
void BKE_reports_print(ReportList *reports, eReportType level);
Report *BKE_reports_last_displayable(ReportList *reports);