File tree Expand file tree Collapse file tree 2 files changed +4
-15
lines changed
scripts/logging/dictionary/dictionary_parser Expand file tree Collapse file tree 2 files changed +4
-15
lines changed Original file line number Diff line number Diff line change 568568 " UP036" , # https://docs.astral.sh/ruff/rules/outdated-version-block
569569 " UP038" , # https://docs.astral.sh/ruff/rules/non-pep604-isinstance
570570]
571- "./scripts/logging/dictionary/dictionary_parser/log_database.py" = [
572- " I001" , # https://docs.astral.sh/ruff/rules/unsorted-imports
573- " SIM103" , # https://docs.astral.sh/ruff/rules/needless-bool
574- " UP015" , # https://docs.astral.sh/ruff/rules/redundant-open-modes
575- " UP039" , # https://docs.astral.sh/ruff/rules/unnecessary-class-parentheses
576- ]
577571"./scripts/logging/dictionary/dictionary_parser/log_parser.py" = [
578572 " I001" , # https://docs.astral.sh/ruff/rules/unsorted-imports
579573]
Original file line number Diff line number Diff line change 1313import json
1414
1515from .mipi_syst import gen_syst_xml_file
16- from .utils import extract_one_string_in_section
17- from .utils import find_string_in_mappings
18-
16+ from .utils import extract_one_string_in_section , find_string_in_mappings
1917
2018ARCHS = {
2119 "arc" : {
5149}
5250
5351
54- class LogDatabase () :
52+ class LogDatabase :
5553 """Class of log database"""
5654 # Update this if database format of dictionary based logging
5755 # has changed
@@ -168,10 +166,7 @@ def set_string_mappings(self, database):
168166
169167 def has_string_mappings (self ):
170168 """Return True if there are string mappings in database"""
171- if 'string_mappings' in self .database :
172- return True
173-
174- return False
169+ return 'string_mappings' in self .database
175170
176171
177172 def has_string_sections (self ):
@@ -253,7 +248,7 @@ def get_kconfigs(self):
253248 def read_json_database (db_file_name ):
254249 """Read database from file and return a LogDatabase object"""
255250 try :
256- with open (db_file_name , "r" , encoding = "iso-8859-1" ) as db_fd :
251+ with open (db_file_name , encoding = "iso-8859-1" ) as db_fd :
257252 json_db = json .load (db_fd )
258253 except (OSError , json .JSONDecodeError ):
259254 return None
You can’t perform that action at this time.
0 commit comments