@@ -93,40 +93,22 @@ def check_errors(self, decoder, message):
9393 def report (self , message ):
9494 """Print the message information."""
9595 print (
96- "%-15s = %s" # pylint: disable=consider-using-f-string
97- % (
98- "name" ,
99- message .__class__ .__name__ ,
100- )
96+ f"{ 'name' :.15s} = { message .__class__ .__name__ } "
10197 )
10298 for k_dict , v_dict in message .__dict__ .items ():
10399 if isinstance (v_dict , dict ):
104- print ("%- 15s =" % k_dict ) # pylint: disable=consider-using-f-string
100+ print (f" { k_dict :. 15s} =")
105101 for k_item , v_item in v_dict .items ():
106- print (
107- " %-12s => %s" # pylint: disable=consider-using-f-string
108- % (k_item , v_item )
102+ print (f" { k_item :.12s} => { v_item } "
109103 )
110104 elif isinstance (v_dict , collections .abc .Iterable ):
111- print ("%- 15s =" % k_dict ) # pylint: disable=consider-using-f-string
105+ print (f" { k_dict :. 15s} =")
112106 value = str ([int (x ) for x in v_dict ])
113107 for line in textwrap .wrap (value , 60 ):
114- print (
115- "%-15s . %s" # pylint: disable=consider-using-f-string
116- % ("" , line )
117- )
108+ print (f"{ ' ' :.15s} . { line } " )
118109 else :
119- print (
120- "%-15s = %s" # pylint: disable=consider-using-f-string
121- % (k_dict , hex (v_dict ))
122- )
123- print (
124- "%-15s = %s" # pylint: disable=consider-using-f-string
125- % (
126- "documentation" ,
127- message .__doc__ ,
128- )
129- )
110+ print (f"{ k_dict :.15s} = { hex (v_dict )} " )
111+ print ("{'documentation':.15s} = {message.__doc__}" )
130112
131113
132114# -------------------------------------------------------------------------- #
0 commit comments