Add getActions implementation to pyatspi.
authorWillie Walker <william.walker@sun.com>
Wed, 22 Apr 2009 09:26:44 +0000 (05:26 -0400)
committerWillie Walker <william.walker@sun.com>
Wed, 22 Apr 2009 10:51:40 +0000 (06:51 -0400)
pyatspi/action.py

index f3489d7..fe230ba 100644 (file)
@@ -24,8 +24,6 @@ __all__ = [
 
 #------------------------------------------------------------------------------
 
-#TODO Perhaps use the 'getActions' method to reduce round-trips.
-
 class Action(Accessible):
         """
         An interface through which a user-actionable user interface component
@@ -38,6 +36,16 @@ class Action(Accessible):
         folders, and others.
         """
 
+        def getActions(self):
+                """
+                getActions:
+                Retrieves all the actions at once.  
+                @return : an array of an array of strings in the form
+               [[name, description, keybinding], ...]
+                """
+                func = self.get_dbus_method("getActions", dbus_interface=ATSPI_ACTION)
+                return func()
+
         def doAction(self, index):
                 """
                 doAction: