Skip to content

Commit 5cb3c48

Browse files
committed
logging
1 parent 42752b8 commit 5cb3c48

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

smct/multimonitortool.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ def get_monitor_selection_list():
1919
_monitor_id = row[MMT_CSV_NAME][-1]
2020
_monitor_name = row[MMT_CSV_MONITOR_NAME]
2121
_monitor_serial = row[MMT_CSV_SERIAL_NUMBER]
22-
_monitor_selection_list.append(
23-
f"{_monitor_id} | {_monitor_name} | {_monitor_serial}"
24-
)
25-
log(f"Monitor detected: {_monitor_id} | {_monitor_name} | {_monitor_serial}")
22+
_display_string = f"{_monitor_id} | {_monitor_name} | {_monitor_serial}"
23+
_monitor_selection_list.append(_display_string)
24+
log(f"Monitor detected: {_display_string}")
2625
_monitor_selection_list.sort()
2726
return _monitor_selection_list
2827

@@ -43,27 +42,35 @@ def _run_mmt_command(command, destination):
4342
],
4443
check=True,
4544
)
46-
log(f"MultiMonitorTool.exe {command} {destination}")
4745
except subprocess.CalledProcessError as error:
4846
log(f"MultiMonitorTool.exe {command} {destination} failed: {error}")
4947

5048

5149
def save_mmt_config():
50+
_command = "/SaveConfig"
51+
log(f"MultiMonitorTool.exe {_command} {paths.MMT_CONFIG_PATH}")
5252
_run_mmt_command("/SaveConfig", paths.MMT_CONFIG_PATH)
5353

5454

5555
def enable_monitor():
56-
_run_mmt_command("/LoadConfig", paths.MMT_CONFIG_PATH)
56+
_command = "/LoadConfig"
57+
log(f"MultiMonitorTool.exe {_command} {paths.MMT_CONFIG_PATH}")
58+
_run_mmt_command(_command, paths.MMT_CONFIG_PATH)
5759

5860

5961
def disable_monitor():
62+
_command = "/disable"
6063
selected_monitor_id = get_selected_monitor_id()
6164
if selected_monitor_id:
62-
_run_mmt_command("/disable", selected_monitor_id)
65+
_run_mmt_command(_command, selected_monitor_id)
66+
log(f"MultiMonitorTool.exe {_command} {selected_monitor_id}")
67+
else:
68+
log("disable_monitor() - Can't find selected monitor id")
6369

6470

6571
def enable_all_disabled_monitors():
6672
disabled_monitor_ids = _get_all_disabled_monitor_ids()
73+
log("enable_all_disabled_monitors()")
6774
for _monitor_id in disabled_monitor_ids:
6875
_run_mmt_command("/enable", _monitor_id)
6976

0 commit comments

Comments
 (0)