Re: [pygtk] Writing python bindings, getting pygobject_new_full assertion failed error. Need assistance.

2009-12-14 Thread John Stowers
On Sun, 2009-12-13 at 11:17 -0500, Adam Plumb wrote:
> Hallelujah!  After days of agony and frustration I finally figured
> this out.
> 
> I'm using the pygobject h2def.py script to generate my .defs file from
> the thunarx header files, and for all my object definitions (i.e.
> ThunarxMenuProvider, etc), it was using the define-object call.  But
> apparently, it needs to use the define-interface call, because once I
> changed it to define-interface, everything worked perfectly.  I only
> noticed this after looking at the nautilus-python's generated
> nautilus.c file, which was calling pyg_register_interface() rather
> than the pygobject_register_class() function all my objects were
> using.  I then looked at the nautilus defs file and it was using the
> define-interface call rather than the define-object call.  Changing
> "object" to "interface" fixed it for me.
> 
> Is this a bug in h2def.py?  Can someone explain it to me?

You should not trust the output of h2def.py completely.

Every binding I have ever made has required some small hand modification
of the defs file generated by h2def.py.

John

___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/


Re: [pygtk] Writing python bindings, getting pygobject_new_full assertion failed error. Need assistance.

2009-12-13 Thread Adam Plumb
Hallelujah!  After days of agony and frustration I finally figured this out.

I'm using the pygobject h2def.py script to generate my .defs file from the
thunarx header files, and for all my object definitions (i.e.
ThunarxMenuProvider, etc), it was using the define-object call.  But
apparently, it needs to use the define-interface call, because once I
changed it to define-interface, everything worked perfectly.  I only noticed
this after looking at the nautilus-python's generated nautilus.c file, which
was calling pyg_register_interface() rather than the
pygobject_register_class() function all my objects were using.  I then
looked at the nautilus defs file and it was using the define-interface call
rather than the define-object call.  Changing "object" to "interface" fixed
it for me.

Is this a bug in h2def.py?  Can someone explain it to me?

Adam

On Fri, Dec 11, 2009 at 10:57 AM, Adam Plumb  wrote:

> I'm working on writing python bindings for the Thunar extension framework
> (the code is based on the nautilus python bindings) and I'm pretty close,
> but I can't figure out how to get past this error that happens when I try to
> convert a GObject variable to a PyObject variable.
>
> The call that is causing the trouble is pygobject_new() and I get the
> following error:
>
> TypeError: multiple bases have instance lay-out conflict
> **
> ERROR:/build/buildd/pygobject-2.18.0/gobject/pygobject.c:924:pygobject_new_full:
> assertion failed: (tp != NULL)
> Aborted
>
> The code in question is here:
> http://github.com/adamplumb/thunarx-python/blob/master/src/thunarx-python-object.cline
>  147.
>
> My project is up at http://github.com/adamplumb/thunarx-python and it
> compiles and installs, it just needs thunar master from
> http://git.xfce.org/xfce/thunar/ to run.  To reproduce the issue, load up
> thunar with the bindings loaded and a python extension (available in the
> examples folder) loaded and right click on a folder or file.
>
> I feel like there is a tiny thing I'm doing wrong here and would appreciate
> it if some folks could look over my code and see if they can see any glaring
> causes for this.
>
> Thanks,
> Adam
>
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

[pygtk] Writing python bindings, getting pygobject_new_full assertion failed error. Need assistance.

2009-12-11 Thread Adam Plumb
I'm working on writing python bindings for the Thunar extension framework
(the code is based on the nautilus python bindings) and I'm pretty close,
but I can't figure out how to get past this error that happens when I try to
convert a GObject variable to a PyObject variable.

The call that is causing the trouble is pygobject_new() and I get the
following error:

TypeError: multiple bases have instance lay-out conflict
**
ERROR:/build/buildd/pygobject-2.18.0/gobject/pygobject.c:924:pygobject_new_full:
assertion failed: (tp != NULL)
Aborted

The code in question is here:
http://github.com/adamplumb/thunarx-python/blob/master/src/thunarx-python-object.cline
147.

My project is up at http://github.com/adamplumb/thunarx-python and it
compiles and installs, it just needs thunar master from
http://git.xfce.org/xfce/thunar/ to run.  To reproduce the issue, load up
thunar with the bindings loaded and a python extension (available in the
examples folder) loaded and right click on a folder or file.

I feel like there is a tiny thing I'm doing wrong here and would appreciate
it if some folks could look over my code and see if they can see any glaring
causes for this.

Thanks,
Adam
___
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/