[orca-list] Help with Accerciser iPython console




Hi.

Sorry to ask a novice Accerciser/ipython question on this list. I did not find an Accerciser mailing list, and the IRC channel seems inactive
I thought perhaps a few of you Orca folks might have experience with this sort of thing.

I need to test my handling of atk_editable_text_insert_text(AtkEditableText *text, const gchar *string, gint length, gint *position) by sending insertText to an object that implements EditableText.

The problem is that the pesky "position" parameter wants a pointer to an integer.

I have tried all sorts of ways to get Accerciser's iPython console to accept the last parameter, but I always get: "TypeError: could not marshal arg 'position'."

At first, I tried just passing in an integer variable (hoping it was "by reference"), then I tried passing in a pointer to the variable using the id() function, then I tried creating a single-value integer array and passing that in... no luck. I also tried using the array() function, but apparently Accerciser's iPython does not support that. I also tried various combinations of C-like syntax, such as &pos and *pos, but the parser didn't like those either.

Has anyone ever tried to do this? If so, how did you do it?

Here's a sample of the things I tried, fyi:

In [1]: t=acc.queryEditableText()
In [2]: t.getText(0,45)
Out[2]: 'The quick brown fox jumps over the lazy dog.\n'
In [3]: t.deleteText(10,15)
Out[3]: True
In [4]: t.getText(0,40)
Out[4]: 'The quick  fox jumps over the lazy dog.\n'
In [5]: pos=10
In [6]: t.insertText("brown",5,pos)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

/usr/lib/python2.6/dist-packages/pyatspi/accessible.pyc in _inner(self, *args, **kwargs)
    230     try:
    231       # try calling the original func

--> 232       return func(self, *args, **kwargs)
    233     except ORBit.CORBA.NO_IMPLEMENT, e:
    234       # raise Python exception

TypeError: could not marshal arg 'position'

In [7]: t.insertText("brown",5,id(pos))
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

/usr/lib/python2.6/dist-packages/pyatspi/accessible.pyc in _inner(self, *args, **kwargs)
    230     try:
    231       # try calling the original func

--> 232       return func(self, *args, **kwargs)
    233     except ORBit.CORBA.NO_IMPLEMENT, e:
    234       # raise Python exception

TypeError: could not marshal arg 'position'

In [8]: pos=[10]
In [9]: t.insertText("brown",5,pos)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

/usr/lib/python2.6/dist-packages/pyatspi/accessible.pyc in _inner(self, *args, **kwargs)
    230     try:
    231       # try calling the original func

--> 232       return func(self, *args, **kwargs)
    233     except ORBit.CORBA.NO_IMPLEMENT, e:
    234       # raise Python exception

TypeError: could not marshal arg 'position'

In [7]: pos=array([10])
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)

/usr/lib/python2.6/dist-packages/pyatspi/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

NameError: name 'array' is not defined

Thanks,
Carolyn

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