PyRNA: support separators in enum-items lists
Resolves T68260
This commit is contained in:
@@ -1505,6 +1505,10 @@ static const EnumPropertyItem *enum_items_from_py(PyObject *seq_fast,
|
|||||||
/* calculate combine string length */
|
/* calculate combine string length */
|
||||||
totbuf += id_str_size + name_str_size + desc_str_size + 3; /* 3 is for '\0's */
|
totbuf += id_str_size + name_str_size + desc_str_size + 3; /* 3 is for '\0's */
|
||||||
}
|
}
|
||||||
|
else if (item == Py_None) {
|
||||||
|
/* Only set since the rest is cleared. */
|
||||||
|
items[i].identifier = "";
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
MEM_freeN(items);
|
MEM_freeN(items);
|
||||||
PyErr_SetString(PyExc_TypeError,
|
PyErr_SetString(PyExc_TypeError,
|
||||||
@@ -2979,6 +2983,8 @@ PyDoc_STRVAR(
|
|||||||
" When an item only contains 4 items they define ``(identifier, name, description, "
|
" When an item only contains 4 items they define ``(identifier, name, description, "
|
||||||
"number)``.\n"
|
"number)``.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
" Separators may be added using None instead of a tuple."
|
||||||
|
"\n"
|
||||||
" For dynamic values a callback can be passed which returns a list in\n"
|
" For dynamic values a callback can be passed which returns a list in\n"
|
||||||
" the same format as the static list.\n"
|
" the same format as the static list.\n"
|
||||||
" This function must take 2 arguments ``(self, context)``, **context may be None**.\n"
|
" This function must take 2 arguments ``(self, context)``, **context may be None**.\n"
|
||||||
|
Reference in New Issue
Block a user