From b96539a7ccfa0cf37ca1e366f2122e3c0308f252 Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Sat, 10 Jun 2023 20:00:09 +0300 Subject: [PATCH] insndb/core: rename Section.path to Section.csv --- src/openpower/insndb/core.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openpower/insndb/core.py b/src/openpower/insndb/core.py index d235b70d..2c7abe79 100644 --- a/src/openpower/insndb/core.py +++ b/src/openpower/insndb/core.py @@ -682,7 +682,7 @@ class Section(Dataclass): def __repr__(self): return (bin(self) if self else "None") - path: _pathlib.Path + csv: _pathlib.Path bitsel: BitSel suffix: Suffix mode: Mode @@ -696,11 +696,12 @@ class Section(Dataclass): @classmethod def CSV(cls, record): + keymap = {"path": "csv"} typemap = {field.name:field.type for field in _dataclasses.fields(cls)} if record["opcode"] == "NONE": typemap["opcode"] = lambda _: None - return dataclass(cls, record, typemap=typemap) + return dataclass(cls, record, typemap=typemap, keymap=keymap) class Fields: @@ -3664,7 +3665,7 @@ class PPCDatabase: path = (root / "insndb.csv") with open(path, "r", encoding="UTF-8") as stream: for section in sorted(parse(stream, Section.CSV)): - path = (root / section.path) + path = (root / section.csv) opcode_cls = { section.Mode.INTEGER: IntegerOpcode, section.Mode.PATTERN: PatternOpcode, -- 2.30.2