update python api with changes from Joshua's commit r33917. translate reports into python errors.

This commit is contained in:
2010-12-31 05:40:30 +00:00
parent ae51e1c683
commit cdefce51f5
4 changed files with 93 additions and 52 deletions

View File

@@ -138,12 +138,16 @@ char *BPy_enum_as_string(EnumPropertyItem *item)
return cstring;
}
int BPy_reports_to_error(ReportList *reports)
short BPy_reports_to_error(ReportList *reports, const short clear)
{
char *report_str;
report_str= BKE_reports_string(reports, RPT_ERROR);
if(clear) {
BKE_reports_clear(reports);
}
if(report_str) {
PyErr_SetString(PyExc_SystemError, report_str);
MEM_freeN(report_str);
@@ -153,7 +157,7 @@ int BPy_reports_to_error(ReportList *reports)
}
int BPy_errors_to_report(ReportList *reports)
short BPy_errors_to_report(ReportList *reports)
{
PyObject *pystring;
PyObject *pystring_format= NULL; // workaround, see below