scripts: dictionary: rename parser module to avoid name collision
The parser module collides with a module in python called parser. Doesn't seem to be a problem in Linux but for some reason the search/include order in Windows causes python to import the wrong parser. The change is to rename the module to dictionary_parser to avoid the name space collision. fixes: #36339 Signed-off-by: David Leach <david.leach@nxp.com>
This commit is contained in:
parent
5daf0b2fad
commit
f5b0f92bb7
@ -18,8 +18,8 @@ import os
|
||||
import struct
|
||||
import sys
|
||||
|
||||
import parser.log_database
|
||||
from parser.log_database import LogDatabase
|
||||
import dictionary_parser.log_database
|
||||
from dictionary_parser.log_database import LogDatabase
|
||||
|
||||
import elftools
|
||||
from elftools.elf.elffile import ELFFile
|
||||
@ -175,7 +175,7 @@ def process_kconfigs(elf, database):
|
||||
database.set_tgt_bits(64 if "CONFIG_64BIT" in kconfigs else 32)
|
||||
|
||||
# Architecture
|
||||
for name, arch in parser.log_database.ARCHS.items():
|
||||
for name, arch in dictionary_parser.log_database.ARCHS.items():
|
||||
if arch['kconfig'] in kconfigs:
|
||||
database.set_arch(name)
|
||||
break
|
||||
@ -194,7 +194,7 @@ def extract_static_string_sections(elf, database):
|
||||
|
||||
# Some architectures may put static strings into additional sections.
|
||||
# So need to extract them too.
|
||||
arch_data = parser.log_database.ARCHS[database.get_arch()]
|
||||
arch_data = dictionary_parser.log_database.ARCHS[database.get_arch()]
|
||||
if "extra_string_section" in arch_data:
|
||||
string_sections.extend(arch_data['extra_string_section'])
|
||||
|
||||
|
||||
@ -16,8 +16,8 @@ import binascii
|
||||
import logging
|
||||
import sys
|
||||
|
||||
import parser
|
||||
from parser.log_database import LogDatabase
|
||||
import dictionary_parser
|
||||
from dictionary_parser.log_database import LogDatabase
|
||||
|
||||
|
||||
LOGGER_FORMAT = "%(message)s"
|
||||
@ -63,7 +63,7 @@ def main():
|
||||
if args.hex:
|
||||
if args.rawhex:
|
||||
# Simply log file with only hexadecimal data
|
||||
logdata = parser.utils.convert_hex_file_to_bin(args.logfile)
|
||||
logdata = dictionary_parser.utils.convert_hex_file_to_bin(args.logfile)
|
||||
else:
|
||||
hexdata = ''
|
||||
|
||||
@ -109,7 +109,7 @@ def main():
|
||||
|
||||
logfile.close()
|
||||
|
||||
log_parser = parser.get_parser(database)
|
||||
log_parser = dictionary_parser.get_parser(database)
|
||||
if log_parser is not None:
|
||||
logger.debug("# Build ID: %s", database.get_build_id())
|
||||
logger.debug("# Target: %s, %d-bit", database.get_arch(), database.get_tgt_bits())
|
||||
|
||||
Loading…
Reference in New Issue
Block a user