diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-24 06:39:38 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2013-02-24 06:39:38 +0400 |
commit | 3df023ae82eef0ea105dc61c9730af87b59a07d1 (patch) | |
tree | 2d2a4e753c1129fc91f360f0457d30859cd38737 /source/blender/freestyle/intern/python/Iterator | |
parent | d38a335d47f1632000db5172877499ff0184d114 (diff) |
Freestyle Python API improvements - part 8.
* Proper handling of keyword arguments was implemented in Operators and ContextFunctions,
as well as in methods of Interface0D, Interface1D, Iterator, their subclasses, Noise and
IntegrationType.
* Operators' methods and functions in the ContextFunctions module were renamed from
CamelCase to lower cases + underscores. Style modules were updated accordingly.
* Additional code clean-up was also made.
Diffstat (limited to 'source/blender/freestyle/intern/python/Iterator')
-rw-r--r-- | source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp index af648a66bb7..701f6871cc1 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp @@ -134,7 +134,6 @@ static PyObject *ChainingIterator_init(BPy_ChainingIterator *self) return NULL; } self->c_it->init(); - Py_RETURN_NONE; } @@ -152,27 +151,25 @@ PyDoc_STRVAR(ChainingIterator_traverse_doc, " :return: Returns the next ViewEdge to follow, or None if chaining ends.\n" " :rtype: :class:`ViewEdge` or None"); -static PyObject *ChainingIterator_traverse(BPy_ChainingIterator *self, PyObject *args) +static PyObject *ChainingIterator_traverse(BPy_ChainingIterator *self, PyObject *args, PyObject *kwds) { + static const char *kwlist[] = {"it", NULL}; PyObject *py_a_it; - if(!(PyArg_ParseTuple(args, "O!", &AdjacencyIterator_Type, &py_a_it))) - return NULL; - if (typeid(*(self->c_it)) == typeid(ChainingIterator)) { PyErr_SetString(PyExc_TypeError, "traverse() method not properly overridden"); return NULL; } + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &AdjacencyIterator_Type, &py_a_it)) + return NULL; if (((BPy_AdjacencyIterator *)py_a_it)->a_it) self->c_it->traverse(*(((BPy_AdjacencyIterator *)py_a_it)->a_it)); - Py_RETURN_NONE; } - static PyMethodDef BPy_ChainingIterator_methods[] = { {"init", (PyCFunction) ChainingIterator_init, METH_NOARGS, ChainingIterator_init_doc}, - {"traverse", (PyCFunction) ChainingIterator_traverse, METH_VARARGS, ChainingIterator_traverse_doc}, + {"traverse", (PyCFunction) ChainingIterator_traverse, METH_VARARGS | METH_KEYWORDS, ChainingIterator_traverse_doc}, {NULL, NULL, 0, NULL} }; |