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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-15 14:43:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-15 14:43:35 +0300
commitd5316768c3fd76a74bfae490a8ce1e9ffacf39ba (patch)
treeb32cef7274c75424630ecaf0b15fe6c8b4d0454c /source/blender/python
parent3ce233e28d51fb31cf13e8791052e503ecae96ec (diff)
corrention for bpy.props docstrings.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_props.c82
1 files changed, 67 insertions, 15 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index e685be2238f..9548bd9b8d1 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -162,6 +162,16 @@ static PyObject *bpy_prop_deferred_return(PyObject *func, PyObject *kw)
} \
+#define BPY_PROPDEF_NAME_DOC \
+" :arg name: Name used in the user interface.\n" \
+" :type name: string\n" \
+
+
+#define BPY_PROPDEF_DESC_DOC \
+" :arg description: Text used for the tooltip and api documentation.\n" \
+" :type description: string\n" \
+
+
#if 0
static int bpy_struct_id_used(StructRNA *srna, char *identifier)
{
@@ -179,11 +189,13 @@ static char BPy_BoolProperty_doc[] =
"\n"
" Returns a new boolean property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"
-" :type subtype: string";
-
+" :type subtype: string\n"
+;
static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -225,10 +237,17 @@ static char BPy_BoolVectorProperty_doc[] =
"\n"
" Returns a new vector boolean property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
+" :arg default: sequence of booleans the length of *size*.\n"
+" :type default: sequence\n"
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
" :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'].\n"
-" :type subtype: string";
+" :type subtype: string\n"
+" :arg size: Vector dimensions in [1, and " STRINGIFY(PYRNA_STACK_ARRAY) "].\n"
+" :type size: int\n"
+;
static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -282,10 +301,13 @@ static char BPy_IntProperty_doc[] =
"\n"
" Returns a new int property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"
-" :type subtype: string";
+" :type subtype: string\n"
+;
static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -328,10 +350,17 @@ static char BPy_IntVectorProperty_doc[] =
"\n"
" Returns a new vector int property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
+" :arg default: sequence of ints the length of *size*.\n"
+" :type default: sequence\n"
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
" :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'].\n"
-" :type subtype: string";
+" :type subtype: string\n"
+" :arg size: Vector dimensions in [1, and " STRINGIFY(PYRNA_STACK_ARRAY) "].\n"
+" :type size: int\n"
+;
static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -386,12 +415,15 @@ static char BPy_FloatProperty_doc[] =
"\n"
" Returns a new float property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"
" :type subtype: string\n"
" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION'].\n"
-" :type unit: string\n";
+" :type unit: string\n"
+;
static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -442,10 +474,17 @@ static char BPy_FloatVectorProperty_doc[] =
"\n"
" Returns a new vector float property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
+" :arg default: sequence of floats the length of *size*.\n"
+" :type default: sequence\n"
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
" :arg subtype: Enumerator in ['COLOR', 'TRANSLATION', 'DIRECTION', 'VELOCITY', 'ACCELERATION', 'MATRIX', 'EULER', 'QUATERNION', 'AXISANGLE', 'XYZ', 'COLOR_GAMMA', 'LAYER', 'NONE'].\n"
-" :type subtype: string";
+" :type subtype: string\n"
+" :arg size: Vector dimensions in [1, and " STRINGIFY(PYRNA_STACK_ARRAY) "].\n"
+" :type size: int\n"
+;
static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -499,10 +538,13 @@ static char BPy_StringProperty_doc[] =
"\n"
" Returns a new string property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
" :arg subtype: Enumerator in ['FILE_PATH', 'DIR_PATH', 'FILENAME', 'NONE'].\n"
-" :type subtype: string";
+" :type subtype: string\n"
+;
static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -635,12 +677,15 @@ static char BPy_EnumProperty_doc[] =
"\n"
" Returns a new enumerator property definition.\n"
"\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
" :arg default: The default value for this enum, A string when *ENUM_FLAG* is disabled otherwise a set which may only contain string identifiers used in *items*.\n"
" :type default: string or set\n"
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE', 'ENUM_FLAG'].\n"
" :type options: set\n"
" :arg items: sequence of enum items formatted: [(identifier, name, description), ...] where the identifier is used for python access and other values are used for the interface.\n"
-" :type items: sequence of string triplets";
+" :type items: sequence of string triplets\n"
+;
static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -715,14 +760,17 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix
}
static char BPy_PointerProperty_doc[] =
-".. function:: PointerProperty(items, type=\"\", description=\"\", default=\"\", options={'ANIMATABLE'})\n"
+".. function:: PointerProperty(type=\"\", description=\"\", options={'ANIMATABLE'})\n"
"\n"
" Returns a new pointer property definition.\n"
"\n"
+" :arg type: A subclass of :class:`bpy.types.IDPropertyGroup`.\n"
+" :type type: class\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
-" :arg type: Dynamic type from :mod:`bpy.types`.\n"
-" :type type: class";
+;
static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -763,10 +811,13 @@ static char BPy_CollectionProperty_doc[] =
"\n"
" Returns a new collection property definition.\n"
"\n"
+" :arg type: A subclass of :class:`bpy.types.IDPropertyGroup`.\n"
+" :type type: class\n"
+BPY_PROPDEF_NAME_DOC
+BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
-" :arg type: Dynamic type from :mod:`bpy.types`.\n"
-" :type type: class";
+;
static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -808,7 +859,8 @@ static char BPy_RemoveProperty_doc[] =
" Removes a dynamically defined property.\n"
"\n"
" :arg attr: Property name.\n"
-" :type attr: string";
+" :type attr: string\n"
+;
static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;