From a070e712526e433c236753813acc3ef300f0d203 Mon Sep 17 00:00:00 2001 From: Simon Feltman Date: Sat, 15 Mar 2014 00:35:03 -0700 Subject: docs: Ignore meta-class bases in dynamic docstring generation Skip attempts at generating a doc string for GObject meta-class bases since they do not contain an __info__ attribute. This circumvents errors with documentation generators (Sphinx). --- gi/types.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gi/types.py b/gi/types.py index 4f0d76ed..ce6d961a 100644 --- a/gi/types.py +++ b/gi/types.py @@ -197,7 +197,7 @@ _gobject._install_metaclass(_GObjectMetaBase) class GObjectMeta(_GObjectMetaBase, MetaClassHelper): - + """Meta class used for GI GObject based types.""" def __init__(cls, name, bases, dict_): super(GObjectMeta, cls).__init__(name, bases, dict_) is_gi_defined = False @@ -225,6 +225,8 @@ class GObjectMeta(_GObjectMetaBase, MetaClassHelper): @property def __doc__(cls): + if cls == GObjectMeta: + return '' return generate_doc_string(cls.__info__) @@ -289,6 +291,7 @@ def mro(C): class StructMeta(type, MetaClassHelper): + """Meta class used for GI Struct based types.""" def __init__(cls, name, bases, dict_): super(StructMeta, cls).__init__(name, bases, dict_) @@ -310,4 +313,6 @@ class StructMeta(type, MetaClassHelper): @property def __doc__(cls): + if cls == StructMeta: + return '' return generate_doc_string(cls.__info__) -- cgit v1.2.1