From a85ad20cc47ab8857f5bba0753903d1c1f7560b5 Mon Sep 17 00:00:00 2001 From: Ivan Kosarev Date: Mon, 27 Dec 2021 19:54:29 +0000 Subject: [PATCH] [#37] Refine verbalizing transistor objects. --- tests/z80sim/z80sim.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/z80sim/z80sim.py b/tests/z80sim/z80sim.py index 7e4c631..90f4a8e 100755 --- a/tests/z80sim/z80sim.py +++ b/tests/z80sim/z80sim.py @@ -46,6 +46,9 @@ def __init__(self, id, gate, c1, c2): self.id, self.gate, self.c1, self.c2 = id, gate, c1, c2 self.state = False + def __repr__(self): + return f'{self.id}({self.c1}, {self.gate}, {self.c2})' + class Z80Simulator(object): def __load_node_names(self): @@ -490,7 +493,7 @@ def pc(self): def dump(self): with open('z80.dump', mode='w') as f: for t in sorted(self.__trans.values(), key=lambda t: t.id): - print(f'{t.id}({t.c1}, {t.gate}, {t.c2})', file=f) + print(t, file=f) # TODO def do_something(self):