From b107b413df896a8daeb37a5a99b9ececf4b70970 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Mon, 3 Jul 2023 21:25:06 -0700 Subject: [PATCH] Ensure System Info is the first group if selected --- scripts/wk/hw/diags.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/wk/hw/diags.py b/scripts/wk/hw/diags.py index 7398d55a..013db695 100644 --- a/scripts/wk/hw/diags.py +++ b/scripts/wk/hw/diags.py @@ -189,7 +189,8 @@ class State(): if 'System' in name: test = Test(dev=self.system, label=name, name=name) - self.test_groups.append( + self.test_groups.insert( + 0, TestGroup( name=name, function=globals()[TEST_GROUPS[name]], @@ -214,8 +215,11 @@ class State(): # Group CPU tests if self.system.tests: + index = 0 + if self.test_groups and self.test_groups[0].name.startswith('System'): + index = 1 self.test_groups.insert( - 0, + index, TestGroup( name='CPU & Cooling', function=run_cpu_tests, @@ -873,7 +877,7 @@ def main() -> None: state.update_title_text('Main Menu') -def post_system_info(state, quick_mode=False, test_mode=False) -> None: +def post_system_info(state, test_objects, test_mode=False) -> None: """Post system info to osTicket.""" # Bail early if state.ost.disabled: @@ -889,6 +893,10 @@ def post_system_info(state, quick_mode=False, test_mode=False) -> None: # Post to osTicket state.ost.post_response('\n'.join(report)) + # Done + test_objects[0].set_status('N/A') + state.update_progress_file() + def print_countdown(proc, seconds) -> None: """Print countdown to screen while proc is alive."""