Title: Documentation of new gobject types fails
Type: behavior Stage:
Components: Documentation tools (Sphinx) Versions: Python 2.5
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: aafshar, georg.brandl
Priority: normal Keywords:

Created on 2008-05-03 17:18 by aafshar, last changed 2008-09-12 15:52 by georg.brandl. This issue is now closed.

File name Uploaded Description Edit
sphinx-err-FK4s9A.log aafshar, 2008-05-03 17:18 Traceback
sphinx-bug-test.tar.gz aafshar, 2008-05-03 21:35 Example of failing case
Messages (3)
msg66158 - (view) Author: Ali Afshar (aafshar) Date: 2008-05-03 17:18
When using the automodule directive on a module that creates new Gobject
types (eg custom PyGTK widget), the implicit registration of the
imported types fail. (Normally any GObject subclass which has a
__gtype_name__ attribute is automatically registered as a new GType
using a metaclass.

I have had a dig around some of the code of gobject, and pygobject, but
not really any help to me.

If anyone wants a quick look.

The directive I am using is:

.. automodule:: pygtkdock

I have also attached the exception I am getting.
msg66175 - (view) Author: Ali Afshar (aafshar) Date: 2008-05-03 21:34
I have managed to reduce the bug to a tiuny test case. It seems that
this only happens when calling automodule directive on a package, with
code in which registers a new GType. Moving the code to a a
regular module inside a package allows it to be imported normally.

I have attached the project directory, and there is a script ""
which just demonstrates how I run the builder to get the PYTHONPATH
correct to be able to improt the package.
msg73097 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-09-12 15:52
This turns out to be caused by the same problem that caused the
SQLAlchemy model failure: the module was imported twice by autodoc.

Should now be fixed in trunk and 0.4.x branch.
Date User Action Args
2008-09-12 15:52:29georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg73097
2008-08-24 22:27:23nnorwitzsettype: crash -> behavior
2008-05-03 21:35:00aafsharsetfiles: + sphinx-bug-test.tar.gz
messages: + msg66175
2008-05-03 17:18:53aafsharcreate