mirror of
https://github.com/netinvent/npbackup.git
synced 2025-09-09 14:35:42 +08:00
Make our linter happy
This commit is contained in:
parent
9b931847ac
commit
19a04b1f9e
1 changed files with 4 additions and 0 deletions
|
@ -31,16 +31,20 @@ def handle_current_window(action: str = "minimize") -> None:
|
|||
|
||||
current_executable = os.path.abspath(sys.argv[0])
|
||||
# console window will have the name of current executable
|
||||
# pylint: disable=I1101 (c-extension-no-member)
|
||||
hwndMain = win32gui.FindWindow(None, current_executable)
|
||||
if not hwndMain:
|
||||
logger.debug(
|
||||
"No hwndmain found for current executable, trying foreground window"
|
||||
)
|
||||
# pylint: disable=I1101 (c-extension-no-member)
|
||||
hwndMain = win32gui.GetForegroundWindow()
|
||||
if hwndMain:
|
||||
if action == "minimize":
|
||||
# pylint: disable=I1101 (c-extension-no-member)
|
||||
win32gui.ShowWindow(hwndMain, win32con.SW_MINIMIZE)
|
||||
elif action == "hide":
|
||||
# pylint: disable=I1101 (c-extension-no-member)
|
||||
win32gui.ShowWindow(hwndMain, win32con.SW_HIDE)
|
||||
else:
|
||||
raise ValueError(
|
||||
|
|
Loading…
Add table
Reference in a new issue