1
from ldtplibutils import *
6
def isPushButtonEnabled (self, accessible):
7
# FIXME: Implement wait_till_object_state_contains
10
def click (self, accessible):
11
if self.isPushButtonEnabled (accessible) == False:
12
return LdtpErrorCode.INVALID_OBJECT_STATE
13
_component = accessible.queryComponent ()
16
_flag = _component.grabFocus ()
18
print 'Grab focus %s' % _flag
20
_action = accessible.queryAction ()
23
_flag = _action.doAction (0) # FIXME: Do action based on event, instead of 0
26
return LdtpErrorCode.SUCCESS
28
return LdtpErrorCode.CLICK_FAILED
30
def pushButtonMain (cctxt, cmd):
31
pushButtonInst = PushButton ()
32
if cmd == command.CLICK:
33
status = pushButtonInst.click (cctxt.guiHandle.handle)
36
elif cmd == command.GRABFOCUS:
37
status = grabFocus (cctxt.guiHandle.handle)
42
return LdtpErrorCode.COMMAND_NOT_IMPLEMENTED