Re: problem with FileChooserDialog in latest git



On Tue, 2010-12-28 at 15:02 -0700, Robert Park wrote:
> Ok, I've managed to isolate this problem in the interactive shell.
> Turns out libchamplain is definitely the culprit. Here it is:
> 
> $ jhbuild run python
> Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
> [GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from gi.repository import Clutter, GtkChamplain, Gtk
> >>> Clutter.init([])
> (<enum CLUTTER_INIT_SUCCESS of type ClutterInitError>, [])
> >>> GtkChamplain.Embed()
> <Embed object at 0x7fd887a9baa0 (GtkChamplainEmbed at 0x207ead0)>
> >>> dialog = Gtk.FileChooserDialog("Open", None, Gtk.FileChooserAction.OPEN, buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OPEN, Gtk.ResponseType.ACCEPT))
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/opt/gnome/lib64/python2.7/site-packages/gi/overrides/Gtk.py",
> line 456, in __init__
>     buttons=buttons)
>   File "/opt/gnome/lib64/python2.7/site-packages/gi/overrides/Gtk.py",
> line 371, in __init__
>     self.add_buttons(*buttons)
>   File "/opt/gnome/lib64/python2.7/site-packages/gi/overrides/Gtk.py",
> line 393, in add_buttons
>     self.add_button(text, response)
> AttributeError: 'FileChooserDialog' object has no attribute 'add_button'
> >>>

As Tomeu suggested, could you check the presence of inherited methods? I
would suggest you to also check the ancestors tree of FileChooserDialog
(FileChooserDialog.__bases__) in both cases (when libchamplain is
imported before and when it is not), and look for differences between
the two.

By the way, is there currently a way to make overrides behave
differently for Gtk-2.0 and Gtk-3.0 for instance? Could be useful for
apps not willing to move to Gtk-3.0 yet (but I don't know whether this
seems acceptable from Gtk maintainers' point of view or not), or some
other library whose API is going to be broken at some point.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]