From 13fc64e6ab192a9a04316d44054656e03fa55b72 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Sat, 8 Apr 2023 14:16:41 -0700 Subject: [PATCH] Remove unneeded wk.ui calls --- scripts/wk/hw/cpu.py | 9 ++++----- scripts/wk/hw/keyboard.py | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/wk/hw/cpu.py b/scripts/wk/hw/cpu.py index af8b0c46..deb8f808 100644 --- a/scripts/wk/hw/cpu.py +++ b/scripts/wk/hw/cpu.py @@ -11,7 +11,6 @@ from wk import ansi, exe from wk.cfg.hw import CPU_FAILURE_TEMP from wk.os.mac import set_fans as macos_set_fans from wk.std import PLATFORM -from wk.ui import cli as ui from wk.ui import tmux @@ -66,7 +65,7 @@ def check_mprime_results(test_obj, working_dir) -> None: if re.search(r'(error|fail)', line, re.IGNORECASE): warning_lines[line] = None - # print.log (check if passed) + # prime.log (check if passed) for line in _read_file('prime.log'): line = line.strip() match = re.search( @@ -170,9 +169,9 @@ def set_apple_fan_speed(speed) -> None: except (RuntimeError, ValueError, subprocess.CalledProcessError) as err: LOG.error('Failed to set fans to %s', speed) LOG.error('Error: %s', err) - ui.print_error(f'Failed to set fans to {speed}') - for line in str(err).splitlines(): - ui.print_warning(f' {line.strip()}') + #ui.print_error(f'Failed to set fans to {speed}') + #for line in str(err).splitlines(): + # ui.print_warning(f' {line.strip()}') elif PLATFORM == 'Linux': cmd = ['apple-fans', speed] exe.run_program(cmd, check=False) diff --git a/scripts/wk/hw/keyboard.py b/scripts/wk/hw/keyboard.py index 83541c45..07d3a22d 100644 --- a/scripts/wk/hw/keyboard.py +++ b/scripts/wk/hw/keyboard.py @@ -5,7 +5,6 @@ import logging from wk.exe import run_program from wk.std import PLATFORM -from wk.ui import cli as ui # STATIC VARIABLES @@ -18,7 +17,8 @@ def keyboard_test() -> None: if PLATFORM == 'Linux': run_xev() else: - ui.print_warning(f'Not supported under this OS: {PLATFORM}') + LOG.error('Not supported under this OS: %s', PLATFORM) + raise NotImplementedError(f'Not supported under this OS: {PLATFORM}') def run_xev() -> None: