Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/generic/idprop_py_api.c
| Show All 14 Lines | |||||
| */ | */ | ||||
| /** \file | /** \file | ||||
| * \ingroup pygen | * \ingroup pygen | ||||
| */ | */ | ||||
| #include <Python.h> | #include <Python.h> | ||||
| #include <string.h> | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "idprop_py_api.h" | #include "idprop_py_api.h" | ||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| ▲ Show 20 Lines • Show All 334 Lines • ▼ Show 20 Lines | if (name == NULL) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| if (name_size > MAX_IDPROP_NAME) { | if (name_size > MAX_IDPROP_NAME) { | ||||
| PyErr_SetString(PyExc_KeyError, | PyErr_SetString(PyExc_KeyError, | ||||
| "the length of IDProperty names is limited to 63 characters"); | "the length of IDProperty names is limited to 63 characters"); | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| if (strchr(name, '\"') || strchr(name, '\\') || strchr(name, '\'')) { | |||||
| PyErr_SetString(PyExc_KeyError, "IDProperty names cannot include \", \\, or \'"); | |||||
| return NULL; | |||||
| } | |||||
| } | } | ||||
| else { | else { | ||||
| name = ""; | name = ""; | ||||
| } | } | ||||
| return name; | return name; | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| ▲ Show 20 Lines • Show All 1,473 Lines • Show Last 20 Lines | |||||