summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Feltman <sfeltman@src.gnome.org>2014-03-15 00:35:03 -0700
committerSimon Feltman <sfeltman@src.gnome.org>2014-03-15 01:01:21 -0700
commita070e712526e433c236753813acc3ef300f0d203 (patch)
treebc1f54375e68a0c31cb40fbb18fd16d5b69230f6
parentec44dea6bbc3f1adfb6c1a2781364a2df0d0e0e6 (diff)
downloadpygobject-a070e712526e433c236753813acc3ef300f0d203.tar.gz
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).
-rw-r--r--gi/types.py7
1 files changed, 6 insertions, 1 deletions
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__)