Skip to content

Commit 01378f1

Browse files
committed
fix: fixed typing checks
1 parent 682a73f commit 01378f1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

aw_qt/manager.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import os
22
import platform
3-
from glob import glob
4-
from time import sleep
3+
import sys
54
import logging
65
import subprocess
76
import shutil
7+
from glob import glob
8+
from time import sleep
89
from typing import Optional, List, Dict, Set, Tuple
910

1011
import aw_core
@@ -110,7 +111,7 @@ def start(self) -> None:
110111

111112
# Create a process group, become its leader
112113
# TODO: This shouldn't go here
113-
if platform.system() != "Windows":
114+
if sys.platform != "win32":
114115
os.setpgrp()
115116

116117
exec_path, location = _locate_executable(self.name)
@@ -126,10 +127,10 @@ def start(self) -> None:
126127
# Don't display a console window on Windows
127128
# See: https://github.com/ActivityWatch/activitywatch/issues/212
128129
startupinfo = None
129-
if platform.system() == "Windows":
130-
startupinfo = subprocess.STARTUPINFO() # type: ignore
131-
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW # type: ignore
132-
elif platform.system() == "Darwin":
130+
if sys.platform == "win32" or sys.platform == "cygwin":
131+
startupinfo = subprocess.STARTUPINFO()
132+
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
133+
elif sys.platform == "darwin":
133134
logger.info("macOS: Disable dock icon")
134135
import AppKit
135136

0 commit comments

Comments
 (0)