Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorAaron Carlisle <carlisle.b3d@gmail.com>2020-09-29 22:05:45 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2020-09-29 22:07:41 +0300
commit4c3047a9cdff686411077b1ccd5709eb221bf41a (patch)
tree65659ed3db866b6227332fe12bdc3f360635b1f9 /source
parentebf752625e3cdd261abd3a737d18d477df6f4379 (diff)
API Docs: Use raises field list syntax
See https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/intern/bpy_rna.c7
-rw-r--r--source/blender/python/intern/bpy_utils_previews.c19
-rw-r--r--source/blender/python/mathutils/mathutils_Matrix.c5
3 files changed, 13 insertions, 18 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index cac82b158d3..e71adbfdf62 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -8708,11 +8708,8 @@ PyDoc_STRVAR(pyrna_register_class_doc,
" If the class has a *register* class method it will be called\n"
" before registration.\n"
"\n"
- " .. note::\n"
- "\n"
- " :exc:`ValueError` exception is raised if the class is not a\n"
- " subclass of a registerable blender class.\n"
- "\n");
+ " :raises ValueError:\n"
+ " if the class is not a subclass of a registerable blender class.\n");
PyMethodDef meth_bpy_register_class = {
"register_class", pyrna_register_class, METH_O, pyrna_register_class_doc};
static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class)
diff --git a/source/blender/python/intern/bpy_utils_previews.c b/source/blender/python/intern/bpy_utils_previews.c
index 32cd7bdddc3..7a826d99a3d 100644
--- a/source/blender/python/intern/bpy_utils_previews.c
+++ b/source/blender/python/intern/bpy_utils_previews.c
@@ -55,14 +55,14 @@ PyDoc_STRVAR(
"\n"
" Generate a new empty preview.\n"
"\n"
- /* This is only true when accessed via 'bpy.utils.previews.ImagePreviewCollection.new',
- * however this is the public API, allow this minor difference to the internal version here. */
- " If ``name`` already exists a KeyError exception is raised.\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"
+ " :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;
@@ -85,10 +85,6 @@ PyDoc_STRVAR(
"\n"
" Generate a new preview from given file path.\n"
"\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. */
- " If ``name`` already exists a KeyError exception is raised.\n"
- "\n"
" :arg name: The name (unique id) identifying the preview.\n"
" :type name: string\n"
" :arg filepath: The file path to generate the preview from.\n"
@@ -100,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;
diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c
index c158ec1da15..427fcad5155 100644
--- a/source/blender/python/mathutils/mathutils_Matrix.c
+++ b/source/blender/python/mathutils/mathutils_Matrix.c
@@ -1687,7 +1687,7 @@ PyDoc_STRVAR(
"\n"
" Set the matrix to its adjugate.\n"
"\n"
- " .. note:: When the matrix cannot be adjugated a :exc:`ValueError` exception is raised.\n"
+ " :raises ValueError: if the matrix cannot be adjugate.\n"
"\n"
" .. seealso:: `Adjugate matrix <https://en.wikipedia.org/wiki/Adjugate_matrix>`__ on "
"Wikipedia.\n");
@@ -1726,8 +1726,7 @@ PyDoc_STRVAR(
"\n"
" :return: the adjugated matrix.\n"
" :rtype: :class:`Matrix`\n"
- "\n"
- " .. note:: When the matrix cant be adjugated a :exc:`ValueError` exception is raised.\n");
+ " :raises ValueError: if the matrix cannot be adjugated\n");
static PyObject *Matrix_adjugated(MatrixObject *self)
{
return matrix__apply_to_copy(Matrix_adjugate, self);