diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-29 18:10:42 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2015-06-29 18:10:42 +0300 |
commit | 58d6cbba6da31db8dc8a2b42d528b9a353081904 (patch) | |
tree | 04b57a2f809c6f08d84a082edf061f3ece631860 /source/blender/python/intern/bpy_interface.c | |
parent | 94549adec4b6857fb6ec4cf77606da51ff7c26b7 (diff) | |
parent | 295d0c52a26730edc6d4ed1276e4051cce006be5 (diff) |
Merge branch 'master' into temp-ghash-setopstemp-ghash-setops
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 5b4db89a41a..7e5ad00159e 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -61,6 +61,8 @@ #include "bpy_traceback.h" #include "bpy_intern_string.h" +#include "bpy_app_translations.h" + #include "DNA_text_types.h" #include "BKE_appdir.h" @@ -358,6 +360,9 @@ void BPY_python_end(void) bpy_intern_string_exit(); + /* bpy.app modules that need cleanup */ + BPY_app_translations_end(); + #ifndef WITH_PYTHON_MODULE BPY_atexit_unregister(); /* without this we get recursive calls to WM_exit */ @@ -590,7 +595,7 @@ int BPY_button_exec(bContext *C, const char *expr, double *value, const bool ver if (error_ret) { if (verbose) { - BPy_errors_to_report(CTX_wm_reports(C)); + BPy_errors_to_report_ex(CTX_wm_reports(C), false, false); } else { PyErr_Clear(); @@ -602,7 +607,7 @@ int BPY_button_exec(bContext *C, const char *expr, double *value, const bool ver return error_ret; } -int BPY_string_exec(bContext *C, const char *expr) +int BPY_string_exec_ex(bContext *C, const char *expr, bool use_eval) { PyGILState_STATE gilstate; PyObject *main_mod = NULL; @@ -625,7 +630,7 @@ int BPY_string_exec(bContext *C, const char *expr) bmain_back = bpy_import_main_get(); bpy_import_main_set(CTX_data_main(C)); - retval = PyRun_String(expr, Py_eval_input, py_dict, py_dict); + retval = PyRun_String(expr, use_eval ? Py_eval_input : Py_file_input, py_dict, py_dict); bpy_import_main_set(bmain_back); @@ -645,6 +650,10 @@ int BPY_string_exec(bContext *C, const char *expr) return error_ret; } +int BPY_string_exec(bContext *C, const char *expr) +{ + return BPY_string_exec_ex(C, expr, true); +} void BPY_modules_load_user(bContext *C) { @@ -779,7 +788,6 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult * } #ifdef WITH_PYTHON_MODULE -#include "BLI_fileops.h" /* TODO, reloading the module isn't functional at the moment. */ static void bpy_module_free(void *mod); @@ -831,7 +839,7 @@ static void bpy_module_delay_init(PyObject *bpy_proxy) static void dealloc_obj_dealloc(PyObject *self); -static PyTypeObject dealloc_obj_Type = {{{0}}}; +static PyTypeObject dealloc_obj_Type; /* use our own dealloc so we can free a property if we use one */ static void dealloc_obj_dealloc(PyObject *self) |