Re: [g-a-devel] Problems with Orca and Accerciser calling GConf client and at-spi2



Hi all,

So we had pyatspi2 importing gconf, using GConf from gi.repository (the new pygi-based binding) if available, to check whether the at-spi-corba key is enabled. (If it could not find a GI typelib for gconf, then it would fall back to trying the old pygtk-based binding. If pyatspi2 was built with --enable-relocate, then all of this code would not be invoked. So this is why some people have been seeing the traceback and some haven't.)

Anyway, I just pushed a change to pyatspi2 to make it call gconftool-2 rather than trying to import gconf. This fixes the issue for me, although it might add 10-20 ms to the startup time, so feel free to test.

I'm not sure if we should even still be using a gconf key for this. We may want to migrate the key to gsettings. The only downside that I see to this is that it leaves open the question of what to do if at-spi-corba is built with --disable-relocate. My inclination would be to leave things as they are in that case, continuing to let at-spi-corba use a gconf key, since AT-SPI-CORBA being the default would correlate with a GNOME 2 setup, but this would mean that the behavior in the two cases is no longer parallel.

Thanks,
-Mike

On Fri, 21 Jan 2011, Piñeiro wrote:


Some people during the last weeks (me included) can't use accerciser,
as it crashes with this error:

Traceback (most recent call last):
 File "/opt/gnome3/bin/accerciser", line 51, in <module>
   accerciser.main()
 File "/opt/gnome3/lib/python2.7/site-packages/accerciser/__init__.py", line 34, in main
   from accerciser import Main
 File "/opt/gnome3/lib/python2.7/site-packages/accerciser/accerciser.py", line 27, in <module>
   from accessible_treeview import *
 File "/opt/gnome3/lib/python2.7/site-packages/accerciser/accessible_treeview.py", line 21, in <module>
   from node import Node
 File "/opt/gnome3/lib/python2.7/site-packages/accerciser/node.py", line 28, in <module>
   cl.get_string('/apps/accerciser/highlight_border') or '#ff0000ff')
 File "/opt/gnome3/lib/python2.7/site-packages/gi/types.py", line 40, in function
   return info.invoke(*args)
TypeError: instance: Must be GConf.Client, not Client

I also have this problem on Orca, but as it normally uses
'try-except', it keeps working, although printing the same error (and
probably explaining why orca constantly goes to the command line).

What I understood from this traceback is that for any reason, it is
trying to use the new pygobject bindings to use gconf, but fails as
accerciser is not migrated yet.

But, it worked using this code on the command line:

  >>> import gconf
  >>> gconf.client_get_default().get_string('/apps/accerciser/highlight_border')
  '#ff0000ff'

So I supposed that importing other module was causing the use of
pygobject introspection bindings. And I found that package:

  >>> import pyatspi
  >>> import gconf
  >>> gconf.client_get_default().get_string('/apps/accerciser/highlight_border')
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/opt/gnome3/lib/python2.7/site-packages/gi/types.py", line 40, in function
      return info.invoke(*args)
  TypeError: instance: Must be GConf.Client, not Client

As problably you know, recently Mike Gorse started to use gobject
introspection for the at-spi2 python bindings, in his work related to
improve the performance.

So I guess that this is a problem caused for a mixed "old python
bindings-new python bindings" environment. No idea why this is still
working for other people. But stay tuned, as this could start to
happen to you soon.

One idea would be try to move the import order on accerciser, but as
far as I see, "import pyatspi" would be required during most of the
running time of accerciser, and "import gconf" just when you required
a property value.

So my question (please, if there are a best ml, point that, AFAIK,
there isn't a gobject introspection mailing list):

 * There is a way to force to "load the old python bindings" when you
   call "import gconf" ?

Of course, the workaroud would be go back to older pyatspi2 (so
at-spi2-core and at-spi2-atk) versions (not ideal, as the
accessibility community should test at-spi2).

BTW, I didn't report this as a bug, because I guess that the "do the
right thing" solution here would be do the gobject introspection
migration on accerciser [2]. Anyway, taking into account Eitan
comments related to Caribou [3], this doesn't seem a easy task.

BR

[1] http://live.gnome.org/Accessibility/GNOME3#pyatspi2_.28D-Bus.29
[2] http://live.gnome.org/GnomeGoals/AddGObjectIntrospectionSupport
[3] http://monotonous.org/2011/01/07/biannual-update/

===
API (apinheiro igalia com)


_______________________________________________
gnome-accessibility-devel mailing list
gnome-accessibility-devel gnome org
http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel


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