Ensure System Info is the first group if selected

This commit is contained in:
2Shirt 2023-07-03 21:25:06 -07:00
parent 67d448e0a0
commit b107b413df
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -189,7 +189,8 @@ class State():
if 'System' in name: if 'System' in name:
test = Test(dev=self.system, label=name, name=name) test = Test(dev=self.system, label=name, name=name)
self.test_groups.append( self.test_groups.insert(
0,
TestGroup( TestGroup(
name=name, name=name,
function=globals()[TEST_GROUPS[name]], function=globals()[TEST_GROUPS[name]],
@ -214,8 +215,11 @@ class State():
# Group CPU tests # Group CPU tests
if self.system.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( self.test_groups.insert(
0, index,
TestGroup( TestGroup(
name='CPU & Cooling', name='CPU & Cooling',
function=run_cpu_tests, function=run_cpu_tests,
@ -873,7 +877,7 @@ def main() -> None:
state.update_title_text('Main Menu') 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.""" """Post system info to osTicket."""
# Bail early # Bail early
if state.ost.disabled: if state.ost.disabled:
@ -889,6 +893,10 @@ def post_system_info(state, quick_mode=False, test_mode=False) -> None:
# Post to osTicket # Post to osTicket
state.ost.post_response('\n'.join(report)) 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: def print_countdown(proc, seconds) -> None:
"""Print countdown to screen while proc is alive.""" """Print countdown to screen while proc is alive."""