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. http://svn.gnome.org/viewvc/pygobject/trunk/gobject/gobjectmodule.c?revision=777&view=markuphttp://svn.gnome.org/viewvc/glib/trunk/gobject/gtype.c?revision=6454&view=markup If anyone wants a quick look. The directive I am using is: .. automodule:: pygtkdock :members: I have also attached the exception I am getting.
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 __init__.py 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 "build.sh" which just demonstrates how I run the builder to get the PYTHONPATH correct to be able to improt the package.
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.
History
Date
User
Action
Args
2022-04-11 14:56:33
admin
set
github: 46996
2008-09-12 15:52:29
georg.brandl
set
status: open -> closedresolution: fixedmessages: +