diff --git a/.ruff-excludes.toml b/.ruff-excludes.toml index 9f23546a57b..252aa734c20 100644 --- a/.ruff-excludes.toml +++ b/.ruff-excludes.toml @@ -568,9 +568,6 @@ "UP036", # https://docs.astral.sh/ruff/rules/outdated-version-block "UP038", # https://docs.astral.sh/ruff/rules/non-pep604-isinstance ] -"./scripts/logging/dictionary/dictionary_parser/log_parser_v3.py" = [ - "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports -] "./scripts/logging/dictionary/dictionary_parser/mipi_syst.py" = [ "I001", # https://docs.astral.sh/ruff/rules/unsorted-imports ] diff --git a/scripts/logging/dictionary/dictionary_parser/log_parser_v3.py b/scripts/logging/dictionary/dictionary_parser/log_parser_v3.py index f72dde1f604..954d9622ee6 100644 --- a/scripts/logging/dictionary/dictionary_parser/log_parser_v3.py +++ b/scripts/logging/dictionary/dictionary_parser/log_parser_v3.py @@ -17,12 +17,12 @@ version 3 databases. import logging import struct + import colorama from colorama import Fore -from .log_parser import (LogParser, get_log_level_str_color, formalize_fmt_string) from .data_types import DataTypes - +from .log_parser import LogParser, formalize_fmt_string, get_log_level_str_color HEX_BYTES_IN_LINE = 16 @@ -101,10 +101,7 @@ class LogParserV3(LogParser): str_idx = arg_offset + self.data_types.get_sizeof(DataTypes.PTR) * 2 str_idx /= self.data_types.get_sizeof(DataTypes.INT) - if int(str_idx) not in string_tbl: - ret = f'' - else: - ret = string_tbl[int(str_idx)] + ret = string_tbl.get(int(str_idx), f"") return ret