After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345341 - New IAccessibleAction methods
New IAccessibleAction methods
Status: RESOLVED FIXED
Product: lsr
Classification: Deprecated
Component: core
0.2.x
Other Linux
: Normal enhancement
: 0.3.0
Assigned To: Peter Parente
LSR maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-19 18:25 UTC by Peter Parente
Modified: 2006-08-02 17:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Never Mind. (39.62 KB, patch)
2006-07-07 16:08 UTC, Eirikur Hallgrimsson
none Details | Review
Never mind. (1.27 KB, text/plain)
2006-07-07 16:11 UTC, Eirikur Hallgrimsson
  Details

Description Peter Parente 2006-06-19 18:25:20 UTC
Add the following IAccessibleAction methods to the appropriate adapters. Do not change the method signatures, but do feel free to change how they are implemented to make them work properly.

setAccCaret()
# move the caret to the location given by self.item_offset+self.char_offset
# can use Text interface and setCaretOffset
# should return False if self.item_offset is None or the result of setCaretOffset otherwise
# should be added to default action adapter
# raise NotImplementedError if Text not supported

setAccText(text)
# replace contents of text area with the given text
# can use EditableText interface and setTextContents method
# should return False if self.item_offset or the result of setTextContents otherwise
# should be added to default action adapter
# raise NotImplementedError if EditableText not supported

insertAccText(text, attrs=None)
# insert the text into the text area starting at self.item_offset+self.char_offset
# attrs is an optional list of string name:value pairs indicating attributes to set on the text
# can use EditableText interface and insertText or insertTextWithAttributes methods as appropriate to the given params
# should return False if self.item_offset is None or the result of insertText*
# should be added to default action adapter
# raise NotImplementedError if EditableText not supported

setAccTextAttrRun(por, attrs)
# set the attrs list of string name:value pairs indicating attributes on the text from self.item_offset+self.char_offset up to por.item_offset+por.char_offset
# can use EditableText interface and setAttributeRun method
# should be added to default action adapter
# should return False if self.item_offset or por.item_offset is None, or the result of setAttributeRun otherwise
# raise ValueError if por.isSameAcc(self.accessible) is False
# raise NotImplementedError if EditableText not supported

copyAccText(por)
# copy the text starting at self.item_offset+self.char_offset up to por.item_offset+por.char_offset
# can use EditableText interface and copyText method
# should be added to default action adapter
# should return False if self.item_offset or por.item_offset is None, or the result of copyText otherwise
# raise ValueError if por.isSameAcc(self.accessible) is False
# raise NotImplementedError if EditableText not supported

cutAccText(por)
# cut the text starting at self.item_offset+self.char_offset up to por.item_offset+por.char_offset
# can use EditableText interface and cutText method
# should be added to default action adapter
# should return False if self.item_offset or por.item_offset is None, or the result of cutText otherwise
# raise ValueError if por.isSameAcc(self.accessible) is False
# raise NotImplementedError if EditableText not supported

deleteAccText(por)
# delete the text starting at self.item_offset+self.char_offset up to por.item_offset+por.char_offset
# can use EditableText interface and deleteText method
# should be added to default action adapter
# should return False if self.item_offset or por.item_offset is None, or the result of deleteText otherwise
# raise ValueError if por.isSameAcc(self.accessible) is False
# raise NotImplementedError if EditableText not supported

pasteAccText(text)
# paste the text at self.item_offset+self.char_offset
# can use EditableText interface and pasteText method
# should be added to default action adapter
# should return False if self.item_offset is None, or the result of pasteText otherwise
# raise NotImplementedError if EditableText not supported
Comment 1 Eirikur Hallgrimsson 2006-06-27 19:34:14 UTC
I'm writing these routines in DefaultAction.py, but I don't know whether they require calling from somewhere parallel to Task/Tools/View.py (which provides scripting support for the routines I've added to Adapters/ATSPI/DefaultInfo.py/class DefaultAccInfoAdapter).

Let me know if they need this (I don't know how to test without some way to call the routines from script or trap the output given some UI input.

They probably require adding to LSRInterfaces.py for documentation purposes, as well, but I'm only guessing here--perhaps they aren't because they aren't scriptable (see above).

Comment 2 Peter Parente 2006-06-27 20:34:28 UTC
You should add the appropriate methods to Task/Tools/View.py. Also add dummy methods to LSRInterfaces.py as documentation.
Comment 3 Eirikur Hallgrimsson 2006-06-29 03:05:59 UTC
Obviously I need to create another class in my testing Perk, EirikurPerk, but I don't know what it should be and what it should be a subclass of.

I'm really unclear on this even after reading most of DefaultPerk.py
and Task/Tools/View.py.

The way the names accessible to Perks map to names in View.py map to names in De faultInfo.py or DefaultAction.py is just not obvious, partly because I'm not familiar with the terminology and partly because "who calls who" isn't clear to me.

A hint would get the show on the road here and I can master the overview later, over time or from documents that I have probably neglected in my eagerness to be coding.
Comment 4 Peter Parente 2006-07-05 03:14:44 UTC
Look at section 7 of the GaimPerk tutorial on the LSR web site (http://live.gnome.org/LSR/ScriptDevelopers/GaimPerkTutorial). You want to define an InputTask subclass and define a hotkey for triggering it. The tutorial tells you how to do both.
Comment 5 Peter Parente 2006-07-06 13:42:57 UTC
Barring any major bugs, let's shoot for having this patch done by Friday, 7/7/06.
Comment 6 Eirikur Hallgrimsson 2006-07-06 18:14:07 UTC
Late Friday afternoon.  I will try for earlier, which is pretty likely.



Comment 7 Eirikur Hallgrimsson 2006-07-07 16:08:33 UTC
Created attachment 68574 [details] [review]
Never Mind.

Defaultinfo.py:

Removed unused includes in DefaultInfo.py
Re-wrote getAccDefAttrs routine entirely to properly return a dict.

Re-wrote getAccAttrs using the code I wrote for getAccDefTextAttrs.  Now returns a dict.  Code was tested in getAccDefTextAttrs().

Fixed epydoc to include input params in getAccText.

LSRInterfaces.py:
Fixed LSRInterfaces.py Removed inappropriate self input params, added epydoc for all input params.

Task/Tools/View.py:
Added epydoc for all input params, including POR.
Re-wrote routines to remove refs to Interfaces.IText and use calls appropriate
to this module.
Comment 8 Eirikur Hallgrimsson 2006-07-07 16:11:44 UTC
Created attachment 68577 [details]
Never mind.

Just a simple text perk.
Comment 9 Eirikur Hallgrimsson 2006-07-07 16:13:55 UTC
Comment on attachment 68574 [details] [review]
Never Mind.

Revised patch with fixes as per. 

Defaultinfo.py:

Removed unused includes in DefaultInfo.py
Re-wrote getAccDefAttrs routine entirely to properly return a dict.

Re-wrote getAccAttrs using the code I wrote for getAccDefTextAttrs.  Now
returns a dict.  Code was tested in getAccDefTextAttrs().

Fixed epydoc to include input params in getAccText.

LSRInterfaces.py:
Fixed LSRInterfaces.py Removed inappropriate self input params, added epydoc
for all input params.

Task/Tools/View.py:
Added epydoc for all input params, including POR.
Re-wrote routines to remove refs to Interfaces.IText and use calls appropriate
to this module.
Comment 10 Peter Parente 2006-07-10 18:59:15 UTC
Added action methods to DefaultAction adapter. Still need Task/Tools/View methods.
Comment 11 Eirikur Hallgrimsson 2006-07-10 21:45:00 UTC
Task/Tools/View methods in progress.  I'm expecting to have something before morning, unless I can't adapt GAIMperk or something for the testing.  In which case I will post the untested code for the record and get realtime help in the morning.  The essential parts of GAIMperk seem to work with GAIM factored-out.
Compile, anyway.

Eirikur
Comment 12 Eirikur Hallgrimsson 2006-07-10 23:34:00 UTC
Got imput-driven test perk working after stripping down the example to the barest bones.  My earlier tries were too ambitious.

My test perk now triggers a stackdump which says that my Task/Tools/View.py 
routines are calling my Adapters/ATSPI/DefaultAction.py routines with an extra added parameter that is coming from somewhere.  We are bombing in PyLinAcc's __init__.py

Here's an example of the call in View.py and the method declaration in
DefaultAction.py, followed by the stack dumps from setAccCaret and setAccText.
This has to be a simple problem.  My IAccessibleInfo routines don't seem to have this problem in that they work fine from my test perk.

View.py:
 return ai.setAccCaret()

DefaultAction.py:
@pyLinAcc.errorToLookupError
  def setAccCaret():





Mon, 10 Jul 2006 19:07:41 ERROR Tier Tier exception
Traceback (most recent call last):
  • File "/home/lsr/lsr/src/Tier.py", line 293 in _executeTask
    rv = task.execute(layer=layer, **task_data)
  • File "/root/.lsr/ui/installed/perk/EirikurPerk.py", line 27 in execute
    print "setAccCaret:", self.setAccCaret()
  • File "/home/lsr/lsr/src/Task/Tools/View.py", line 85 in setAccCaret
    return ai.setAccCaret()
  • File "/home/lsr/lsr/src/pyLinAcc/__init__.py", line 119 in _inner
    return func(self, *args, **kwargs)
TypeError: setAccCaret() takes no arguments (1 given)


Mon, 10 Jul 2006 19:12:29 ERROR Tier Tier exception
Traceback (most recent call last):
  File "/home/lsr/lsr/src/Tier.py", line 293, in _executeTask
    rv = task.execute(layer=layer, **task_data)
  File "/root/.lsr/ui/installed/perk/EirikurPerk.py", line 28, in execute
    print "setAccText:", self.setAccText("Msg. from Eirikur Hallgrimsson.")
  File "/home/lsr/lsr/src/Task/Tools/View.py", line 105, in setAccText
    return ai.setAccText(text)
  File "/home/lsr/lsr/src/pyLinAcc/__init__.py", line 119, in _inner
    return func(self, *args, **kwargs)
TypeError: setAccText() takes exactly 1 argument (2 given)


Help would be appreciated.  It sort of looks like I have version skew or something.

Eirikur
Comment 13 Peter Parente 2006-08-02 17:52:26 UTC
Fixed in the development version. The fix will be available in the next major release. Thank you for your bug report.