Skip to content

Commit f62ed00

Browse files
committed
replaced time.sleep() with stop_event.wait() where applicable
1 parent becc605 commit f62ed00

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

installers/windows_installer.iss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "AppUsageGUI"
5-
#define MyAppVersion "1.3.0"
5+
#define MyAppVersion "1.3.1"
66
#define MyAppPublisher "Adam Blair-Smith"
77
#define MyAppURL "https://github.com/Adam-Color/AppUsageGUI"
88
#define MyAppExeName "AppUsageGUI.exe"
9-
#define MyInstallerName "AppUsageGUI_v1.3.0_WINDOWS_setup"
9+
#define MyInstallerName "AppUsageGUI_v1.3.1_WINDOWS_setup"
1010

1111
[Setup]
1212
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
@@ -46,7 +46,8 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
4646
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
4747

4848
[Files]
49-
Source: "..\dist\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
49+
Source: "..\dist\{#MyAppName}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
50+
Source: "..\dist\{#MyAppName}\_internal\*"; DestDir: "{app}\_internal"; Flags: ignoreversion recursesubdirs createallsubdirs
5051
Source: "..\src\core\resources\icon.ico"; DestDir: "{app}/src/core/resources"; Flags: ignoreversion
5152
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
5253

src/core/logic/app_tracker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _monitor_processes(self):
6464
# Process count has changed; update app names
6565
self.cached_process_count = current_process_count
6666
self.app_names = self._fetch_app_names()
67-
time.sleep(1) # Check periodically to avoid excessive CPU usage
67+
self.stop_event.wait(timeout=1) # Check periodically to avoid excessive CPU usage
6868

6969
def get_app_names(self):
7070
return self.app_names

src/core/screens/session_total_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def total_time_thread(self):
6060
pass
6161

6262
# Sleep for 1 second before the next update
63-
time.sleep(1)
63+
self.stop_event.wait(timeout=1)
6464

6565
def stop_threads(self):
6666
self.stop_event.set()

src/core/screens/tracker_window.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def update_time_label(self):
106106
else:
107107
self.update_queue.put(("time", "Looking for application..."))
108108

109-
time.sleep(0.1)
109+
self.stop_event.wait(timeout=0.1)
110110
if not self.stop_event.is_set():
111111
self.controller.frames["SessionTotalWindow"].stop_threads()
112112
self.controller.show_frame("SaveWindow")

0 commit comments

Comments
 (0)