Fix Python lint warnings related to logging

This commit is contained in:
Dennis Potter 2021-11-07 11:44:07 -08:00
parent 73dfed0146
commit 719b013b88
Signed by: Dennis
GPG Key ID: 186A8AD440942BAF

View File

@ -47,7 +47,6 @@ class Component():
self.field_type = '' self.field_type = ''
# Save object # Save object
# TODO: should probably be list because of alias registers
self.obj = obj self.obj = obj
# Save name # Save name
@ -68,7 +67,7 @@ class Component():
# Create logger object # Create logger object
self.__create_logger(self.full_path, config) self.__create_logger(self.full_path, config)
self.logger.debug(f"Starting to process {self.__class__.__name__} '{obj.inst_name}'") self.logger.info("Starting to process %s '%s'", self.__class__.__name__, obj.inst_name)
def __init_variables(self): def __init_variables(self):
# By default, registers and fields are not interrupt registers # By default, registers and fields are not interrupt registers
@ -156,8 +155,9 @@ class Component():
return self.ports[port_type] return self.ports[port_type]
def get_max_dim_depth(self) -> int: def get_max_dim_depth(self) -> int:
self.logger.debug(f"Return depth '{self.total_dimensions}' for dimensions (including "\ self.logger.debug("Return depth '%s' for dimensions (including parents) '%s'.",
f"parents) '{self.total_array_dimensions}'") self.total_dimensions,
self.total_array_dimensions)
return max([ return max([
self.total_dimensions, self.total_dimensions,
@ -295,10 +295,11 @@ class Component():
if obj.name in ("intr", "halt"): if obj.name in ("intr", "halt"):
pass pass
elif not obj.node.get_property(obj.name): elif not obj.node.get_property(obj.name):
self.logger.fatal(f"Reference to the property '{obj.name}' of instance " self.logger.fatal("Reference to the property '%s' of instance '%s' found"
f"'{obj.node.get_path()}' found. This instance does " "This instance does hold the reference property! Please "
"hold the reference property! Please fix this if you " "fix this if you want me to do my job properly.",
"want me to do my job properly.") obj.name,
obj.node.get_path())
sys.exit(1) sys.exit(1)