use PyDoc_STRVAR macro, so its possible to build without docstrings.

This commit is contained in:
2011-05-24 16:05:51 +00:00
parent 357ce16958
commit 15289c6048
15 changed files with 362 additions and 335 deletions

View File

@@ -194,7 +194,7 @@ static int bpy_struct_id_used(StructRNA *srna, char *identifier)
/* Function that sets RNA, NOTE - self is NULL when called from python, but being abused from C so we can pass the srna allong
* This isnt incorrect since its a python object - but be careful */
static char BPy_BoolProperty_doc[] =
PyDoc_STRVAR(BPy_BoolProperty_doc,
".. function:: BoolProperty(name=\"\", description=\"\", default=False, options={'ANIMATABLE'}, subtype='NONE')\n"
"\n"
" Returns a new boolean property definition.\n"
@@ -205,7 +205,7 @@ BPY_PROPDEF_DESC_DOC
" :type options: set\n"
" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"
" :type subtype: string\n"
;
);
static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -248,7 +248,7 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw)
Py_RETURN_NONE;
}
static char BPy_BoolVectorProperty_doc[] =
PyDoc_STRVAR(BPy_BoolVectorProperty_doc,
".. function:: BoolVectorProperty(name=\"\", description=\"\", default=(False, False, False), options={'ANIMATABLE'}, subtype='NONE', size=3)\n"
"\n"
" Returns a new vector boolean property definition.\n"
@@ -263,7 +263,7 @@ BPY_PROPDEF_DESC_DOC
" :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;
@@ -318,7 +318,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
Py_RETURN_NONE;
}
static char BPy_IntProperty_doc[] =
PyDoc_STRVAR(BPy_IntProperty_doc,
".. function:: IntProperty(name=\"\", description=\"\", default=0, min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, step=1, options={'ANIMATABLE'}, subtype='NONE')\n"
"\n"
" Returns a new int property definition.\n"
@@ -329,7 +329,7 @@ BPY_PROPDEF_DESC_DOC
" :type options: set\n"
" :arg subtype: Enumerator in ['UNSIGNED', 'PERCENTAGE', 'FACTOR', 'ANGLE', 'TIME', 'DISTANCE', 'NONE'].\n"
" :type subtype: string\n"
;
);
static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -374,7 +374,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw)
Py_RETURN_NONE;
}
static char BPy_IntVectorProperty_doc[] =
PyDoc_STRVAR(BPy_IntVectorProperty_doc,
".. function:: IntVectorProperty(name=\"\", description=\"\", default=(0, 0, 0), min=-sys.maxint, max=sys.maxint, soft_min=-sys.maxint, soft_max=sys.maxint, options={'ANIMATABLE'}, subtype='NONE', size=3)\n"
"\n"
" Returns a new vector int property definition.\n"
@@ -389,7 +389,7 @@ BPY_PROPDEF_DESC_DOC
" :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;
@@ -447,7 +447,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
}
static char BPy_FloatProperty_doc[] =
PyDoc_STRVAR(BPy_FloatProperty_doc,
".. function:: FloatProperty(name=\"\", description=\"\", default=0.0, min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', unit='NONE')\n"
"\n"
" Returns a new float property definition.\n"
@@ -460,7 +460,7 @@ BPY_PROPDEF_DESC_DOC
" :type subtype: string\n"
" :arg unit: Enumerator in ['NONE', 'LENGTH', 'AREA', 'VOLUME', 'ROTATION', 'TIME', 'VELOCITY', 'ACCELERATION'].\n"
" :type unit: string\n"
;
);
static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -514,7 +514,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw)
Py_RETURN_NONE;
}
static char BPy_FloatVectorProperty_doc[] =
PyDoc_STRVAR(BPy_FloatVectorProperty_doc,
".. function:: FloatVectorProperty(name=\"\", description=\"\", default=(0.0, 0.0, 0.0), min=sys.float_info.min, max=sys.float_info.max, soft_min=sys.float_info.min, soft_max=sys.float_info.max, step=3, precision=2, options={'ANIMATABLE'}, subtype='NONE', size=3)\n"
"\n"
" Returns a new vector float property definition.\n"
@@ -529,7 +529,7 @@ BPY_PROPDEF_DESC_DOC
" :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;
@@ -586,7 +586,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
Py_RETURN_NONE;
}
static char BPy_StringProperty_doc[] =
PyDoc_STRVAR(BPy_StringProperty_doc,
".. function:: StringProperty(name=\"\", description=\"\", default=\"\", maxlen=0, options={'ANIMATABLE'}, subtype='NONE')\n"
"\n"
" Returns a new string property definition.\n"
@@ -597,7 +597,7 @@ BPY_PROPDEF_DESC_DOC
" :type options: set\n"
" :arg subtype: Enumerator in ['FILE_PATH', 'DIR_PATH', 'FILENAME', 'NONE'].\n"
" :type subtype: string\n"
;
);
static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -741,7 +741,7 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
return items;
}
static char BPy_EnumProperty_doc[] =
PyDoc_STRVAR(BPy_EnumProperty_doc,
".. function:: EnumProperty(items, name=\"\", description=\"\", default=\"\", options={'ANIMATABLE'})\n"
"\n"
" Returns a new enumerator property definition.\n"
@@ -754,7 +754,7 @@ BPY_PROPDEF_DESC_DOC
" :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\n"
;
);
static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -840,7 +840,7 @@ static StructRNA *pointer_type_from_py(PyObject *value, const char *error_prefix
return srna;
}
static char BPy_PointerProperty_doc[] =
PyDoc_STRVAR(BPy_PointerProperty_doc,
".. function:: PointerProperty(type=\"\", description=\"\", options={'ANIMATABLE'})\n"
"\n"
" Returns a new pointer property definition.\n"
@@ -851,7 +851,7 @@ BPY_PROPDEF_NAME_DOC
BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
;
);
static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -893,7 +893,7 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k
Py_RETURN_NONE;
}
static char BPy_CollectionProperty_doc[] =
PyDoc_STRVAR(BPy_CollectionProperty_doc,
".. function:: CollectionProperty(items, type=\"\", description=\"\", default=\"\", options={'ANIMATABLE'})\n"
"\n"
" Returns a new collection property definition.\n"
@@ -904,7 +904,7 @@ BPY_PROPDEF_NAME_DOC
BPY_PROPDEF_DESC_DOC
" :arg options: Enumerator in ['HIDDEN', 'ANIMATABLE'].\n"
" :type options: set\n"
;
);
static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;
@@ -946,14 +946,14 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject
Py_RETURN_NONE;
}
static char BPy_RemoveProperty_doc[] =
PyDoc_STRVAR(BPy_RemoveProperty_doc,
".. function:: RemoveProperty(attr)\n"
"\n"
" Removes a dynamically defined property.\n"
"\n"
" :arg attr: Property name.\n"
" :type attr: string\n"
;
);
static PyObject *BPy_RemoveProperty(PyObject *self, PyObject *args, PyObject *kw)
{
StructRNA *srna;