def hasstate(self, window_name, object_name, state, guiTimeOut=<NUM_LIT:0>):
try:<EOL><INDENT>object_handle = self._get_object_handle(window_name, object_name)<EOL>if state == "<STR_LIT>":<EOL><INDENT>return int(object_handle.AXEnabled)<EOL><DEDENT>elif state == "<STR_LIT>":<EOL><INDENT>return int(object_handle.AXFocused)<EOL><DEDENT>elif state == "<STR_LIT>":<EOL><INDENT>return int(object_handle.AXFocused)<EOL><DEDENT>elif state == "<STR_LIT>":<EOL><INDENT>if re.match("<STR_LIT>", object_handle.AXRole,<EOL>re.M | re.U | re.L) orre.match("<STR_LIT>", object_handle.AXRole,<EOL>re.M | re.U | re.L):<EOL><INDENT>if object_handle.AXValue:<EOL><INDENT>return <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT>return <NUM_LIT:0><EOL>
has state

@param window_name: Window name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to look for, either full name,
LDTP's name convention, or a Unix glob.
@type object_name: string
@type window_name: string
@param state: State of the current object.
@type object_name: string
@param guiTimeOut: Wait timeout in seconds
@type guiTimeOut: integer

@return: 1 on success.
@rtype: integer