[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34862] trunk/blender/source/blender/ python/intern/bpy_props.c: corrention for bpy.props docstrings.

Campbell Barton ideasman42 at gmail.com
Tue Feb 15 12:43:36 CET 2011


Revision: 34862
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34862
Author:   campbellbarton
Date:     2011-02-15 11:43:35 +0000 (Tue, 15 Feb 2011)
Log Message:
-----------
corrention for bpy.props docstrings.

Modified Paths:
--------------
    trunk/blender/source/blender/python/intern/bpy_props.c

Modified: trunk/blender/source/blender/python/intern/bpy_props.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_props.c	2011-02-15 09:24:35 UTC (rev 34861)
+++ trunk/blender/source/blender/python/intern/bpy_props.c	2011-02-15 11:43:35 UTC (rev 34862)
@@ -162,6 +162,16 @@
 	} \
 
 
+#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 @@
 "\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 @@
 "\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 @@
 "\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 @@
 "\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 @@
 "\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 @@
 "\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 @@
 "\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 @@
 "\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 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 @@
 "\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 @@
 "   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;




More information about the Bf-blender-cvs mailing list