diff options
Diffstat (limited to 'source/blender/python/intern/bpy_utils_previews.c')
-rw-r--r-- | source/blender/python/intern/bpy_utils_previews.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/source/blender/python/intern/bpy_utils_previews.c b/source/blender/python/intern/bpy_utils_previews.c index 81b44dd5c43..7a826d99a3d 100644 --- a/source/blender/python/intern/bpy_utils_previews.c +++ b/source/blender/python/intern/bpy_utils_previews.c @@ -49,15 +49,20 @@ #define STR_SOURCE_TYPES "'IMAGE', 'MOVIE', 'BLEND', 'FONT'" -PyDoc_STRVAR(bpy_utils_previews_new_doc, - ".. method:: new(name)\n" - "\n" - " Generate a new empty preview, or return existing one matching ``name``.\n" - "\n" - " :arg name: The name (unique id) identifying the preview.\n" - " :type name: string\n" - " :return: The Preview matching given name, or a new empty one.\n" - " :rtype: :class:`bpy.types.ImagePreview`\n"); +PyDoc_STRVAR( + bpy_utils_previews_new_doc, + ".. method:: new(name)\n" + "\n" + " Generate a new empty preview.\n" + "\n" + " :arg name: The name (unique id) identifying the preview.\n" + " :type name: string\n" + " :return: The Preview matching given name, or a new empty one.\n" + " :rtype: :class:`bpy.types.ImagePreview`\n" + " :rtype: :class:`bpy.types.ImagePreview`\n" + /* This is only true when accessed via 'bpy.utils.previews.ImagePreviewCollection.load', + * however this is the public API, allow this minor difference to the internal version here. */ + " :raises KeyError: if ``name`` already exists."); static PyObject *bpy_utils_previews_new(PyObject *UNUSED(self), PyObject *args) { char *name; @@ -78,7 +83,7 @@ PyDoc_STRVAR( bpy_utils_previews_load_doc, ".. method:: load(name, filepath, filetype, force_reload=False)\n" "\n" - " Generate a new preview from given file path, or return existing one matching ``name``.\n" + " Generate a new preview from given file path.\n" "\n" " :arg name: The name (unique id) identifying the preview.\n" " :type name: string\n" @@ -91,7 +96,10 @@ PyDoc_STRVAR( "exists in cache.\n" " :type force_reload: bool\n" " :return: The Preview matching given name, or a new empty one.\n" - " :rtype: :class:`bpy.types.ImagePreview`\n"); + " :rtype: :class:`bpy.types.ImagePreview`\n" + /* This is only true when accessed via 'bpy.utils.previews.ImagePreviewCollection.load', + * however this is the public API, allow this minor difference to the internal version here. */ + " :raises KeyError: if ``name`` already exists."); static PyObject *bpy_utils_previews_load(PyObject *UNUSED(self), PyObject *args) { char *name, *path, *path_type_s; |