summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 \
}
/**