diff options
| author | 2022-09-17 05:09:46 +0530 | |
|---|---|---|
| committer | 2022-09-17 05:09:46 +0530 | |
| commit | 2a606b947dc318a783cfd202a446c03586a95cf4 (patch) | |
| tree | 188e5dcd818a5357dfadffd9d9eb452fb115feaa /src/Watcher/get_windows.py | |
| parent | cd43e6c2ae541c1d5cb96f04c94f92b3f56f5735 (diff) | |
| download | shopno-os-log-sync-2a606b947dc318a783cfd202a446c03586a95cf4.tar.gz shopno-os-log-sync-2a606b947dc318a783cfd202a446c03586a95cf4.zip | |
updated algorithm | update csv at every second
Diffstat (limited to '')
| -rwxr-xr-x | src/Watcher/get_windows.py | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/Watcher/get_windows.py b/src/Watcher/get_windows.py index 0769eb9..008defa 100755 --- a/src/Watcher/get_windows.py +++ b/src/Watcher/get_windows.py @@ -42,18 +42,10 @@ def active_window(): return active_window # returns true if user has move to next app which is not the same as previous -def is_window_changed(a, afk, timeout): - result = False - while not(result): - time.sleep(0.5) - b = active_window() - if a != b : - result = True - elif get_afk_status(afk, timeout): - result = True - else: - result = False - return result +def previous_window(array_of_window, active_window): + array_of_window.remove(active_window) + array_of_window.append(active_window) + return l[-2] ### what to do after window get change I've to append one line in csv data file in following format |
