From c0cf43d5b5b5db8fe04a7da244d584a5317536c0 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 15 Jun 2023 18:52:59 +1000 Subject: [PATCH] Tools: tidy solution_status_change.py NFC, just a bit tidier --- Tools/scripts/solution_status_change.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Tools/scripts/solution_status_change.py b/Tools/scripts/solution_status_change.py index 8a1f863095..4a052aa0e4 100755 --- a/Tools/scripts/solution_status_change.py +++ b/Tools/scripts/solution_status_change.py @@ -53,23 +53,24 @@ class SolutionStatusChange(object): old_message_per_core = {} while True: m = self.conn.recv_match(type=desired_type) + if m.C != 0: + continue if m is None: break if m.C not in old_message_per_core: old_message_per_core[m.C] = m continue - ss = m.SS current = old_message_per_core[m.C] - if ss == current.SS: + if m.SS == current.SS: continue line = "" - for bit in bit_descriptions.keys(): - old_bit_set = current.SS & (1 << bit_descriptions[bit]) - new_bit_set = ss & (1 << bit_descriptions[bit]) + for (name, bit) in bit_descriptions.items(): + old_bit_set = current.SS & (1 << bit) + new_bit_set = m.SS & (1 << bit) if new_bit_set and not old_bit_set: - line += " +%s" % bit + line += " +%s" % name elif not new_bit_set and old_bit_set: - line += " -%s" % bit + line += " -%s" % name old_message_per_core[m.C] = m