insndb/db: deindent classes
authorDmitry Selyutin <ghostmansd@gmail.com>
Sat, 3 Jun 2023 10:25:56 +0000 (13:25 +0300)
committerDmitry Selyutin <ghostmansd@gmail.com>
Sat, 3 Jun 2023 15:00:27 +0000 (18:00 +0300)
src/openpower/insndb/db.py

index ac65a31a150c9a7f1a41cc32feb90acb3869151b..c66a07e77f87734b360444dba5f030d6cc9765f0 100644 (file)
@@ -11,29 +11,32 @@ from openpower.insndb.core import (
 )
 
 
-def main():
-    class GenericVisitor(Visitor):
-        def __init__(self, **_):
-            pass
-
-    class ListVisitor(GenericVisitor):
-        @contextlib.contextmanager
-        def record(self, record):
-            print(record.name)
-            yield record
-
-    class OpcodesVisitor(GenericVisitor):
-        def __init__(self, insn, **_):
-            self.__insn = insn
-            return super().__init__()
-
-        @contextlib.contextmanager
-        def record(self, record):
-            if record.name == self.__insn:
-                for opcode in record.opcodes:
-                    print(opcode)
-            yield record
+class GenericVisitor(Visitor):
+    def __init__(self, **_):
+        pass
+
+
+class ListVisitor(GenericVisitor):
+    @contextlib.contextmanager
+    def record(self, record):
+        print(record.name)
+        yield record
+
 
+class OpcodesVisitor(GenericVisitor):
+    def __init__(self, insn, **_):
+        self.__insn = insn
+        return super().__init__()
+
+    @contextlib.contextmanager
+    def record(self, record):
+        if record.name == self.__insn:
+            for opcode in record.opcodes:
+                print(opcode)
+        yield record
+
+
+def main():
     visitors = {
         "list": ListVisitor,
         "opcodes": OpcodesVisitor,