diff options
author | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-01-11 15:39:43 +0000 |
---|---|---|
committer | Gustavo J. A. M. Carneiro <gjc@src.gnome.org> | 2006-01-11 15:39:43 +0000 |
commit | a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f (patch) | |
tree | 318f725ab7d568ea84b363c92f80c55a69d34b0e | |
parent | c3d7d3eb3353dee65828ae5f74c3408a37f18ac8 (diff) | |
download | pygobject-a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f.tar.gz |
reorder more nicely information presented in docstring about signals and properties
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | gobject/pygtype.c | 26 |
2 files changed, 20 insertions, 11 deletions
@@ -1,5 +1,10 @@ 2006-01-11 Gustavo J. A. M. Carneiro <gjc@inescporto.pt> + * gobject/pygtype.c (object_doc_descr_get): Reorder + properties/signals documentation more nicely: signals + properties + from each type are presented, with types ranging from the leaf + types to the base types. + * configure.ac: Branch, bump version to 2.9.1. === PyGObject 2.8.0 === diff --git a/gobject/pygtype.c b/gobject/pygtype.c index ebb9dd8c..a1400a02 100644 --- a/gobject/pygtype.c +++ b/gobject/pygtype.c @@ -1422,30 +1422,34 @@ object_doc_descr_get(PyObject *self, PyObject *obj, PyObject *type) else g_string_append_printf(string, "%s\n\n", g_type_name(gtype)); + if (((PyTypeObject *) type)->tp_doc) + g_string_append_printf(string, "%s\n\n", ((PyTypeObject *) type)->tp_doc); + if (g_type_is_a(gtype, G_TYPE_OBJECT)) { GType parent = G_TYPE_OBJECT; - - while (parent) { + GArray *parents = g_array_new(FALSE, FALSE, sizeof(GType)); + int iparent; + + while (parent) { + g_array_append_val(parents, parent); + parent = g_type_next_base(gtype, parent); + } + + for (iparent = parents->len - 1; iparent >= 0; --iparent) { GType *interfaces; guint n_interfaces, i; + parent = g_array_index(parents, GType, iparent); add_signal_docs(parent, string); + add_property_docs(parent, string); /* add docs for implemented interfaces */ interfaces = g_type_interfaces(parent, &n_interfaces); for (i = 0; i < n_interfaces; i++) add_signal_docs(interfaces[i], string); g_free(interfaces); - - parent = g_type_next_base(gtype, parent); - } - parent = G_TYPE_OBJECT; - while (parent) { - add_property_docs(parent, string); - parent = g_type_next_base(gtype, parent); } - } else if (g_type_is_a(gtype, G_TYPE_OBJECT)) { - add_signal_docs(gtype, string); + g_array_free(parents, TRUE); } pystring = PyString_FromStringAndSize(string->str, string->len); |