utilitz 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {utilitz-0.3.1 → utilitz-0.3.2}/PKG-INFO +1 -1
- {utilitz-0.3.1 → utilitz-0.3.2}/pyproject.toml +1 -1
- {utilitz-0.3.1 → utilitz-0.3.2}/src/utilitz/sys.py +6 -4
- {utilitz-0.3.1 → utilitz-0.3.2}/.gitignore +0 -0
- {utilitz-0.3.1 → utilitz-0.3.2}/LICENSE +0 -0
- {utilitz-0.3.1 → utilitz-0.3.2}/README.md +0 -0
- {utilitz-0.3.1 → utilitz-0.3.2}/src/utilitz/__init__.py +0 -0
- {utilitz-0.3.1 → utilitz-0.3.2}/src/utilitz/excel.py +0 -0
- {utilitz-0.3.1 → utilitz-0.3.2}/src/utilitz/io.py +0 -0
- {utilitz-0.3.1 → utilitz-0.3.2}/src/utilitz/path.py +0 -0
|
@@ -109,9 +109,11 @@ def monitor_keep_alive(seconds, key='ctrl', verbose=1):
|
|
|
109
109
|
|
|
110
110
|
monitor = MonitorActivity()
|
|
111
111
|
monitor.start()
|
|
112
|
-
status = '
|
|
112
|
+
status = '==START=='
|
|
113
113
|
sleep_start_time = time.time()
|
|
114
114
|
time.sleep(seconds)
|
|
115
|
+
if verbose:
|
|
116
|
+
print(datetime.fromtimestamp(sleep_end_time).strftime("%Y-%m-%d %H:%M:%S"), status)
|
|
115
117
|
while True:
|
|
116
118
|
sleep_end_time = time.time()
|
|
117
119
|
####
|
|
@@ -121,11 +123,11 @@ def monitor_keep_alive(seconds, key='ctrl', verbose=1):
|
|
|
121
123
|
inactive_time = sleep_end_time-last_activity_time
|
|
122
124
|
if is_active:
|
|
123
125
|
last_status = status
|
|
124
|
-
status = '
|
|
126
|
+
status = '==ACTIVE=='
|
|
125
127
|
sleep_time = seconds - inactive_time
|
|
126
128
|
else:
|
|
127
129
|
last_status = status
|
|
128
|
-
status = '
|
|
130
|
+
status = '==INACTIVE=='
|
|
129
131
|
sleep_time = seconds
|
|
130
132
|
pyautogui.press(key)
|
|
131
133
|
if verbose == 1 and status != last_status:
|
|
@@ -133,7 +135,7 @@ def monitor_keep_alive(seconds, key='ctrl', verbose=1):
|
|
|
133
135
|
"%Y-%m-%d %H:%M:%S"), status)
|
|
134
136
|
elif verbose == 2:
|
|
135
137
|
print(datetime.fromtimestamp(sleep_end_time).strftime("%Y-%m-%d %H:%M:%S"), status,
|
|
136
|
-
'\n\tInactive Time', f'{inactive_time:.03f}', 'Sleep Time', f'{sleep_time:.03f}')
|
|
138
|
+
'\n\tInactive Time:', f'{inactive_time:.03f}', 'Sleep Time:', f'{sleep_time:.03f}')
|
|
137
139
|
|
|
138
140
|
sleep_start_time = time.time()
|
|
139
141
|
time.sleep(sleep_time)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|