[Bf-blender-cvs] [699c8c8] ui-preview-buttons: Avoid repeating self

Campbell Barton noreply at git.blender.org
Mon May 11 15:32:39 CEST 2015


Commit: 699c8c86b9b799769a4240686872a06ba8902f71
Author: Campbell Barton
Date:   Mon May 11 23:32:14 2015 +1000
Branches: ui-preview-buttons
https://developer.blender.org/rB699c8c86b9b799769a4240686872a06ba8902f71

Avoid repeating self

===================================================================

M	source/blender/python/intern/bpy_utils_previews.c

===================================================================

diff --git a/source/blender/python/intern/bpy_utils_previews.c b/source/blender/python/intern/bpy_utils_previews.c
index f7ce205..bd8edc5 100644
--- a/source/blender/python/intern/bpy_utils_previews.c
+++ b/source/blender/python/intern/bpy_utils_previews.c
@@ -53,6 +53,8 @@
 
 #include "../generic/python_utildefines.h"
 
+#define STR_SOURCE_TYPES "'IMAGE', 'MOVIE', 'BLEND', 'FONT'"
+
 PyDoc_STRVAR(bpy_utils_previews_new_doc,
 ".. method:: new(name)\n"
 "\n"
@@ -92,7 +94,7 @@ PyDoc_STRVAR(bpy_utils_previews_load_doc,
 "   :type name: string\n"
 "   :arg path: The file path to generate the preview from.\n"
 "   :type path: string\n"
-"   :arg path_type: The type of file, needed to generate the preview ('IMAGE', 'MOVIE', 'BLEND' or 'FONT').\n"
+"   :arg path_type: The type of file, needed to generate the preview in [" STR_SOURCE_TYPES "].\n"
 "   :type path_type: string\n"
 "   :arg force_reload: If True, force running thumbnail manager even if preview already exists in cache.\n"
 "   :type force_reload: bool\n"
@@ -129,7 +131,7 @@ static PyObject *bpy_utils_previews_load(PyObject *UNUSED(self), PyObject *args,
 	}
 	else {
 		PyErr_Format(PyExc_ValueError,
-		             "load: invalid '%' path type, only 'IMAGE', 'MOVIE', 'BLEND' and 'FONT' "
+		             "load: invalid '%' path type, only [" STR_SOURCE_TYPES "] "
 		             "are supported", path_type_s);
 		return NULL;
 	}




More information about the Bf-blender-cvs mailing list