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 /gobject | |
| parent | c3d7d3eb3353dee65828ae5f74c3408a37f18ac8 (diff) | |
| download | pygobject-a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f.tar.gz pygobject-a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f.tar.xz pygobject-a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f.zip | |
reorder more nicely information presented in docstring about signals and properties
Diffstat (limited to 'gobject')
| -rw-r--r-- | gobject/pygtype.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c index ebb9dd8..a1400a0 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); |
