def getallstates(self, window_name, object_name):
object_handle = self._get_object_handle(window_name, object_name)<EOL>_obj_states = []<EOL>if object_handle.AXEnabled:<EOL><INDENT>_obj_states.append("<STR_LIT>")<EOL><DEDENT>if object_handle.AXFocused:<EOL><INDENT>_obj_states.append("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>if object_handle.AXFocused:<EOL><INDENT>_obj_states.append("<STR_LIT>")<EOL><DEDENT><DEDENT>except:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if re.match("<STR_LIT>", object_handle.AXRole, 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>_obj_states.append("<STR_LIT>")<EOL><DEDENT><DEDENT>return _obj_states<EOL>
Get all states of given object

@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

@return: list of string on success.
@rtype: list