diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-22 00:26:54 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-10-22 00:26:54 +0400 |
commit | 9adfa289e800a52a7c4a47ea3ee8dcdf5b50f9c2 (patch) | |
tree | 5afda3e9a0463fd4fb7f502281bb41a36ff1d1a7 /source/blender/python | |
parent | 10af15b85b743a18215a1fc58799264b5c798403 (diff) | |
parent | 932aa116df985d21114dcad8c2518f69f8a6a39e (diff) |
Cycles: svn merge -r41157:41182 ^/trunk/blender
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/BPY_extern.h | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 2 |
4 files changed, 6 insertions, 11 deletions
diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index cd5c8e53ef7..ae82dac7f14 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -36,8 +36,6 @@ #ifndef BPY_EXTERN_H #define BPY_EXTERN_H -extern char bprogname[]; /* holds a copy of argv[0], from creator.c */ - struct Text; /* defined in DNA_text_types.h */ struct ID; /* DNA_ID.h */ struct Object; /* DNA_object_types.h */ diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index bd7be8dd9c5..c3d60bc353d 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -93,8 +93,6 @@ static PyStructSequence_Desc app_info_desc= { static PyObject *make_app_info(void) { - extern char bprogname[]; /* argv[0] from creator.c */ - PyObject *app_info; int pos= 0; @@ -118,7 +116,7 @@ static PyObject *make_app_info(void) SetStrItem(""); #endif SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE)); - SetStrItem(bprogname); + SetStrItem(BLI_program_path()); SetObjItem(PyBool_FromLong(G.background)); /* build info */ @@ -200,8 +198,7 @@ static int bpy_app_debug_value_set(PyObject *UNUSED(self), PyObject *value, void static PyObject *bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure)) { - extern char btempdir[]; - return PyC_UnicodeFromByte(btempdir); + return PyC_UnicodeFromByte(BLI_temporary_dir()); } static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(closure)) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 725414a6104..a937dcb1c89 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -198,9 +198,9 @@ void BPY_python_start(int argc, const char **argv) PyThreadState *py_tstate= NULL; /* not essential but nice to set our name */ - static wchar_t bprogname_wchar[FILE_MAXDIR+FILE_MAXFILE]; /* python holds a reference */ - BLI_strncpy_wchar_from_utf8(bprogname_wchar, bprogname, sizeof(bprogname_wchar) / sizeof(wchar_t)); - Py_SetProgramName(bprogname_wchar); + static wchar_t program_path_wchar[FILE_MAXDIR+FILE_MAXFILE]; /* python holds a reference */ + BLI_strncpy_wchar_from_utf8(program_path_wchar, BLI_program_path(), sizeof(program_path_wchar) / sizeof(wchar_t)); + Py_SetProgramName(program_path_wchar); /* must run before python initializes */ PyImport_ExtendInittab(bpy_internal_modules); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index e52df8f9320..a6306909699 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1534,7 +1534,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb param= _PyUnicode_AsString(value); #ifdef WITH_INTERNATIONAL if (subtype == PROP_TRANSLATE) { - param= UI_translate_do_iface(param); + param= IFACE_(param); } #endif // WITH_INTERNATIONAL |