def grabfocus(self, window_name, object_name=None):
if not object_name:<EOL><INDENT>handle, name, app = self._get_window_handle(window_name)<EOL><DEDENT>else:<EOL><INDENT>handle = self._get_object_handle(window_name, object_name)<EOL><DEDENT>return self._grabfocus(handle)<EOL>
Grab focus.

@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: 1 on success.
@rtype: integer