Skip to content

Commit

Permalink
Fix doc strings.
Browse files Browse the repository at this point in the history
Remove debug logging in SetFocus.
  • Loading branch information
moden-py committed Nov 17, 2015
1 parent fdf8bc9 commit 72673a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pywinauto/controls/HwndWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1565,12 +1565,11 @@ def GetFocus(self):

#-----------------------------------------------------------
def SetFocus(self):

"""
Set the focus to this control.
Bring the window to the foreground first if necessary.
"""

# find the current foreground window
cur_foreground = win32gui.GetForegroundWindow()

Expand All @@ -1593,10 +1592,6 @@ def SetFocus(self):
cur_fore_thread,
1)

self.actions.log('Call SetForegroundWindow within attached '
'threads - {0} & {1}.'.format(control_thread,
cur_fore_thread,
))
win32gui.SetForegroundWindow(self.handle)

# ensure foreground window has changed to the target
Expand All @@ -1605,7 +1600,7 @@ def SetFocus(self):
Timings.setfocus_timeout,
Timings.setfocus_retry,
lambda: win32gui.GetForegroundWindow()
in [self.TopLevelParent().handle, 0])
in [self.TopLevelParent().handle, 0])

# get the threads again to check they are still valid.
cur_fore_thread = win32process.GetWindowThreadProcessId(
Expand All @@ -1620,7 +1615,6 @@ def SetFocus(self):
0)
else:
# same threads - just set the foreground window
self.actions.log('Call SetForegroundWindow within one thread.')
win32gui.SetForegroundWindow(self.handle)

# make sure that we are idle before returning
Expand Down
2 changes: 2 additions & 0 deletions pywinauto/timings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
* after_windowclose_retry (default .5)
* after_setfocus_wait (default .06)
* setfocus_timeout (default 2)
* setfocus_retry (default .1)
* after_setcursorpos_wait (default .01)
Expand Down

0 comments on commit 72673a8

Please sign in to comment.