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 <ideasman42@gmail.com>2010-10-04 05:18:47 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-04 05:18:47 +0400
commit314121ee65a5d2aadb9be56afcc31201e0eda596 (patch)
tree849a29b4b041caa62abe8b9ee89301b4ed2cb38e
parent0540512866de95d86ce1e3be7318ee735ae09b90 (diff)
- use own string conversion function over PyUnicode_FromString when converting the argv
- report errors when files dont load when given from the command line but not running in background mode.
-rw-r--r--source/blender/blenkernel/intern/report.c1
-rw-r--r--source/blender/python/intern/bpy_interface.c19
-rw-r--r--source/creator/creator.c5
3 files changed, 7 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/report.c b/source/blender/blenkernel/intern/report.c
index 3773757f5d5..f69547fd1da 100644
--- a/source/blender/blenkernel/intern/report.c
+++ b/source/blender/blenkernel/intern/report.c
@@ -127,6 +127,7 @@ void BKE_reportf(ReportList *reports, ReportType type, const char *format, ...)
va_start(args, format);
vprintf(format, args);
va_end(args);
+ fprintf(stdout, "\n"); /* otherise each report needs to include a \n */
fflush(stdout); /* this ensures the message is printed before a crash */
}
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index b905fb3729e..bc79ba94756 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -213,25 +213,10 @@ void BPY_start_python( int argc, char **argv )
/* sigh, why do python guys not have a char** version anymore? :( */
{
int i;
-#if 0
PyObject *py_argv= PyList_New(argc);
for (i=0; i<argc; i++)
- PyList_SET_ITEM(py_argv, i, PyUnicode_FromString(argv[i]));
-
-#else // should fix bug #20021 - utf path name problems
- PyObject *py_argv= PyList_New(0);
- for (i=0; i<argc; i++) {
- PyObject *item= PyUnicode_Decode(argv[i], strlen(argv[i]), Py_FileSystemDefaultEncoding, NULL);
- if(item==NULL) { // should never happen
- PyErr_Print();
- PyErr_Clear();
- }
- else {
- PyList_Append(py_argv, item);
- Py_DECREF(item);
- }
- }
-#endif
+ PyList_SET_ITEM(py_argv, i, PyC_UnicodeFromByte(argv[i])); /* should fix bug #20021 - utf path name problems, by replacing PyUnicode_FromString */
+
PySys_SetObject("argv", py_argv);
Py_DECREF(py_argv);
}
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 8e17bec361f..83392224444 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -897,7 +897,10 @@ static int load_file(int argc, char **argv, void *data)
} else {
/* we are not running in background mode here, but start blender in UI mode with
a file - this should do everything a 'load file' does */
- WM_read_file(C, filename, NULL);
+ ReportList reports;
+ BKE_reports_init(&reports, RPT_PRINT);
+ WM_read_file(C, filename, &reports);
+ BKE_reports_clear(&reports);
}
G.file_loaded = 1;