diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-03-22 07:28:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-03-22 07:28:51 +0300 |
commit | 1b80538fea5b42f5b3111066f617d94a4ffc180c (patch) | |
tree | 68cbdb095a32dc28b0c76341132946f6e768690a /source | |
parent | 3384679aecfe93ae72bd34eb9b17095db2603eb2 (diff) |
fix [#25688] undocumted functions in pyapi
expose collection function docs.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 9 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 42 |
2 files changed, 42 insertions, 9 deletions
diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 68ab94b8b4f..fcbe4171a08 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1566,7 +1566,6 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float ho return 0; } -int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports); /* return 0; nothing happened */ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) @@ -1623,7 +1622,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_DEFAULT, op->ptr); - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_translate", 0), event, op->ptr, NULL); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_translate", 0), event, op->ptr, NULL, FALSE); } else if (drawflags & MAN_SCALE_C) { switch(drawflags) { @@ -1654,11 +1653,11 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_resize", WM_OP_INVOKE_DEFAULT, op->ptr); - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL, FALSE); } else if (drawflags == MAN_ROT_T) { /* trackball need special case, init is different */ - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL); WM_operator_name_call(C, "TRANSFORM_OT_trackball", WM_OP_INVOKE_DEFAULT, op->ptr); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL, FALSE); } else if (drawflags & MAN_ROT_C) { switch(drawflags) { @@ -1674,7 +1673,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op) } RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis); WM_operator_name_call(C, "TRANSFORM_OT_rotate", WM_OP_INVOKE_DEFAULT, op->ptr); - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_rotate", 0), event, op->ptr, NULL); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_rotate", 0), event, op->ptr, NULL, FALSE); } } /* after transform, restore drawflags */ diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 6ae38d66781..0dfc98de487 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -3294,6 +3294,14 @@ static PyGetSetDef pyrna_struct_getseters[]= { {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; +static char pyrna_prop_collection_keys_doc[] = +".. method:: keys()\n" +"\n" +" Return the identifiers of collection members (matching pythons dict.keys() functionality).\n" +"\n" +" :return: the identifiers for each member of this collection.\n" +" :rtype: list of stings\n" +; static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self) { PyObject *ret= PyList_New(0); @@ -3319,6 +3327,14 @@ static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self) return ret; } +static char pyrna_prop_collection_items_doc[] = +".. method:: items()\n" +"\n" +" Return the identifiers of collection members (matching pythons dict.items() functionality).\n" +"\n" +" :return: (key, value) pairs for each member of this collection.\n" +" :rtype: list of tuples\n" +; static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self) { PyObject *ret= PyList_New(0); @@ -3352,6 +3368,14 @@ static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self) return ret; } +static char pyrna_prop_collection_values_doc[] = +".. method:: values()\n" +"\n" +" Return the values of collection (matching pythons dict.values() functionality).\n" +"\n" +" :return: the members of this collection.\n" +" :rtype: list\n" +; static PyObject *pyrna_prop_collection_values(BPy_PropertyRNA *self) { /* re-use slice*/ @@ -3414,6 +3438,16 @@ static PyObject *pyrna_struct_as_pointer(BPy_StructRNA *self) return PyLong_FromVoidPtr(self->ptr.data); } +static char pyrna_prop_collection_get_doc[] = +".. method:: get(key, default=None)\n" +"\n" +" Returns the value of the item assigned to key or default when not found (matches pythons dictionary function of the same name).\n" +"\n" +" :arg key: The identifier for the collection member.\n" +" :type key: string\n" +" :arg default: Optional argument for the value to return if *key* is not found.\n" +" :type default: Undefined\n" +; static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args) { PointerRNA newptr; @@ -3804,11 +3838,11 @@ static struct PyMethodDef pyrna_prop_collection_methods[]= { {"foreach_get", (PyCFunction)pyrna_prop_collection_foreach_get, METH_VARARGS, pyrna_prop_collection_foreach_get_doc}, {"foreach_set", (PyCFunction)pyrna_prop_collection_foreach_set, METH_VARARGS, pyrna_prop_collection_foreach_set_doc}, - {"keys", (PyCFunction)pyrna_prop_collection_keys, METH_NOARGS, NULL}, - {"items", (PyCFunction)pyrna_prop_collection_items, METH_NOARGS, NULL}, - {"values", (PyCFunction)pyrna_prop_collection_values, METH_NOARGS, NULL}, + {"keys", (PyCFunction)pyrna_prop_collection_keys, METH_NOARGS, pyrna_prop_collection_keys_doc}, + {"items", (PyCFunction)pyrna_prop_collection_items, METH_NOARGS, pyrna_prop_collection_items_doc}, + {"values", (PyCFunction)pyrna_prop_collection_values, METH_NOARGS, pyrna_prop_collection_values_doc}, - {"get", (PyCFunction)pyrna_prop_collection_get, METH_VARARGS, NULL}, + {"get", (PyCFunction)pyrna_prop_collection_get, METH_VARARGS, pyrna_prop_collection_get_doc}, {NULL, NULL, 0, NULL} }; |