From 8f817de0cbef41dac81e6c7665ada509c3fe2988 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 8 Mar 2019 09:29:17 +1100 Subject: Cleanup: use plural names for Main lists Convention was not to but after discussion on 918941483f7e we agree its best to change the convention. Names now mostly follow RNA. Some exceptions: - Use 'nodetrees' instead of 'nodegroups' since the struct is called NodeTree. - Use 'gpencils' instead of 'grease_pencil' since 'gpencil' is a common abbreviation in the C code. Other exceptions: - Leave 'wm' as it's a list of one. - Leave 'ipo' as is for versioning. --- source/blender/python/generic/bpy_internal_import.c | 6 +++--- source/blender/python/intern/bpy_interface.c | 4 ++-- source/blender/python/intern/bpy_rna.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/python') diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index d4adcad8318..96b5645f0e7 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -186,7 +186,7 @@ PyObject *bpy_text_import_name(const char *name, int *found) memcpy(txtname, name, namelen); memcpy(&txtname[namelen], ".py", 4); - text = BLI_findstring(&maggie->text, txtname, offsetof(ID, name) + 2); + text = BLI_findstring(&maggie->texts, txtname, offsetof(ID, name) + 2); if (text) { *found = 1; @@ -196,7 +196,7 @@ PyObject *bpy_text_import_name(const char *name, int *found) /* If we still haven't found the module try additional modules form bpy_import_main_list */ maggie = bpy_import_main_list.first; while (maggie && !text) { - text = BLI_findstring(&maggie->text, txtname, offsetof(ID, name) + 2); + text = BLI_findstring(&maggie->texts, txtname, offsetof(ID, name) + 2); maggie = maggie->next; } @@ -245,7 +245,7 @@ PyObject *bpy_text_reimport(PyObject *module, int *found) } /* look up the text object */ - text = BLI_findstring(&maggie->text, BLI_path_basename(filepath), offsetof(ID, name) + 2); + text = BLI_findstring(&maggie->texts, BLI_path_basename(filepath), offsetof(ID, name) + 2); /* uh-oh.... didn't find it */ if (!text) diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 2a33c316f55..189fb97f3d2 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -518,7 +518,7 @@ static bool python_script_exec( if (do_jump) { /* ensure text is valid before use, the script may have freed its self */ Main *bmain_new = CTX_data_main(C); - if ((bmain_old == bmain_new) && (BLI_findindex(&bmain_new->text, text) != -1)) { + if ((bmain_old == bmain_new) && (BLI_findindex(&bmain_new->texts, text) != -1)) { python_script_error_jump_text(text); } } @@ -761,7 +761,7 @@ void BPY_modules_load_user(bContext *C) bpy_context_set(C, &gilstate); - for (text = bmain->text.first; text; text = text->id.next) { + for (text = bmain->texts.first; text; text = text->id.next) { if (text->flags & TXT_ISSCRIPT && BLI_path_extension_check(text->id.name + 2, ".py")) { if (!(G.f & G_FLAG_SCRIPT_AUTOEXEC)) { if (!(G.f & G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index cba6d2203fa..cb1555f8cc4 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2343,7 +2343,7 @@ static int pyrna_prop_collection_subscript_str_lib_pair_ptr( else if (PyUnicode_Check(keylib)) { Main *bmain = self->ptr.data; const char *keylib_str = _PyUnicode_AsString(keylib); - lib = BLI_findstring(&bmain->library, keylib_str, offsetof(Library, name)); + lib = BLI_findstring(&bmain->libraries, keylib_str, offsetof(Library, name)); if (lib == NULL) { if (err_not_found) { PyErr_Format(PyExc_KeyError, -- cgit v1.2.3