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 568
568
" UP036" , # https://docs.astral.sh/ruff/rules/outdated-version-block
569
569
" UP038" , # https://docs.astral.sh/ruff/rules/non-pep604-isinstance
570
570
]
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
- ]
577
571
"./scripts/logging/dictionary/dictionary_parser/log_parser.py" = [
578
572
" I001" , # https://docs.astral.sh/ruff/rules/unsorted-imports
579
573
]
Original file line number Diff line number Diff line change 13
13
import json
14
14
15
15
from .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
19
17
20
18
ARCHS = {
21
19
"arc" : {
51
49
}
52
50
53
51
54
- class LogDatabase () :
52
+ class LogDatabase :
55
53
"""Class of log database"""
56
54
# Update this if database format of dictionary based logging
57
55
# has changed
@@ -168,10 +166,7 @@ def set_string_mappings(self, database):
168
166
169
167
def has_string_mappings (self ):
170
168
"""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
175
170
176
171
177
172
def has_string_sections (self ):
@@ -253,7 +248,7 @@ def get_kconfigs(self):
253
248
def read_json_database (db_file_name ):
254
249
"""Read database from file and return a LogDatabase object"""
255
250
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 :
257
252
json_db = json .load (db_fd )
258
253
except (OSError , json .JSONDecodeError ):
259
254
return None
You can’t perform that action at this time.
0 commit comments