summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2020-10-11 22:13:57 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2020-10-11 22:13:57 (GMT)
commit15ca338693167373102f5a44c2694c0adc26d820 (patch)
treeaea2aa0ad4d1ec10c9c7d299e4d94c96043e96db /plugins
parent0b0f69bd1278b8f5d95c6ea8fb56915148992a77 (diff)
Introduced access rights in the Python attributes documentation.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pychrysalide/helpers.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/plugins/pychrysalide/helpers.h b/plugins/pychrysalide/helpers.h
index 45b3083..428cf92 100644
--- a/plugins/pychrysalide/helpers.h
+++ b/plugins/pychrysalide/helpers.h
@@ -118,6 +118,15 @@ bool register_python_module_object(PyObject *, PyTypeObject *);
#name "(" args ")\n--\n\n" doc \
}
+/**
+ * Il ne semble pas exister de moyen de déterminer
+ * si un attribut est inscriptible de façon introspective...
+ * L'indication est donc placée dans la documentation.
+ */
+#define ATTRIB_RO "(ro) "
+#define ATTRIB_WO "(wo) "
+#define ATTRIB_RW "(rw) "
+
#define PYTHON_GETSET_DEF(name, get, set, doc, closure) \
{ \
name, get, set, \
@@ -126,26 +135,26 @@ bool register_python_module_object(PyObject *, PyTypeObject *);
}
#define PYTHON_IS_DEF_FULL(name, base, doc) \
- PYTHON_GETSET_DEF("is_" #name, base ## _is_ ## name, NULL, doc, NULL)
+ PYTHON_GETSET_DEF("is_" #name, base ## _is_ ## name, NULL, ATTRIB_RO doc, NULL)
#define PYTHON_HAS_DEF_FULL(name, base, doc) \
- PYTHON_GETSET_DEF(#name, base ## _has_ ## name, NULL, doc, NULL)
+ PYTHON_GETSET_DEF(#name, base ## _has_ ## name, NULL, ATTRIB_RO doc, NULL)
#define PYTHON_RAWGET_DEF_FULL(name, base, doc) \
- PYTHON_GETSET_DEF(#name, base ## _ ## name, NULL, doc, NULL)
+ PYTHON_GETSET_DEF(#name, base ## _ ## name, NULL, ATTRIB_RO doc, NULL)
#define PYTHON_GET_DEF_FULL(name, base, doc) \
- PYTHON_GETSET_DEF(#name, base ## _get_ ## name, NULL, doc, NULL)
+ PYTHON_GETSET_DEF(#name, base ## _get_ ## name, NULL, ATTRIB_RO doc, NULL)
#define PYTHON_GETSET_DEF_FULL(name, base, doc) \
- PYTHON_GETSET_DEF(#name, base ## _get_ ## name, base ## _set_ ## name, doc, NULL)
+ PYTHON_GETSET_DEF(#name, base ## _get_ ## name, base ## _set_ ## name, ATTRIB_RW doc, NULL)
#define PYTHON_GETTER_WRAPPER_DEF(name, doc) \
{ \
#name, \
(getter)not_yet_implemented_getter, \
NULL, \
- doc, NULL \
+ ATTRIB_RO doc, NULL \
}
/**