From 462fa77fad2ef9caf19f701cc84d6649ff7e3ce8 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Sun, 20 Oct 2024 12:53:41 +1100 Subject: [PATCH] Tools: add --core to solution_status_change.py --- Tools/scripts/solution_status_change.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Tools/scripts/solution_status_change.py b/Tools/scripts/solution_status_change.py index 4a052aa0e4d4a..4431b576eb8bc 100755 --- a/Tools/scripts/solution_status_change.py +++ b/Tools/scripts/solution_status_change.py @@ -17,8 +17,11 @@ class SolutionStatusChange(object): - def __init__(self, master): + def __init__(self, master, core=None): self.master = master + self.core = core + if self.core is not None: + self.core = set(self.core) def progress(self, text): '''emit text with possible timestamps etc''' @@ -53,13 +56,13 @@ def run(self): 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 + if self.core is not None and m.C not in self.core: + continue current = old_message_per_core[m.C] if m.SS == current.SS: continue @@ -86,6 +89,9 @@ def run(self): if __name__ == '__main__': parser = optparse.OptionParser("solution-status-change.py [options]") + parser.add_option("", "--core", action="append", type="int", + default=[], help="core to show (default is all)") + (opts, args) = parser.parse_args() if len(args) < 1: @@ -94,5 +100,8 @@ def run(self): master = args[0] - tester = SolutionStatusChange(master) + if len(opts.core) == 0: + opts.core = None + + tester = SolutionStatusChange(master, core=opts.core) tester.run()