scripts: logging: dictionary: log_parser_v3: Fix linter issues
Fix issues reported by ruff. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
parent
18a8e5c5b5
commit
57df7883b9
2 changed files with 3 additions and 9 deletions
|
@ -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
|
||||
]
|
||||
|
|
|
@ -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'<string@0x{arg:x}>'
|
||||
else:
|
||||
ret = string_tbl[int(str_idx)]
|
||||
ret = string_tbl.get(int(str_idx), f"<string@0x{arg:x}>")
|
||||
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue