11# -*- coding: utf-8 -*-
2- # Copyright (C) 2009, 2013-2014, 2023 Rocky Bernstein
2+ # Copyright (C) 2009, 2013-2014, 2023-2024 Rocky Bernstein
33#
44# This program is free software; you can redistribute it and/or modify
55# it under the terms of the GNU General Public License as published by
1818# 'Helper' function for Processor. Put here so we
1919# can use this in a couple of processors.
2020
21- from trepan import vprocessor as Mprocessor
21+ from typing import Optional
22+ from trepan .vprocessor import Processor
2223
2324
24- class PrintProcessor (Mprocessor . Processor ):
25+ class PrintProcessor (Processor ):
2526 """A processor that just prints out events as we see them. This
2627 is suitable for example for line/call tracing. We assume that the
2728 caller is going to filter out which events it wants printed or
2829 whether it wants any printed at all.
2930 """
3031
31- def __init__ (self , debugger , opts = None ):
32- Mprocessor . Processor .__init__ (self , debugger )
32+ def __init__ (self , debugger , opts : Optional [ dict ] = None ):
33+ Processor .__init__ (self , debugger , opts )
3334 return
3435
3536 def event_processor (self , frame , event , arg ):
@@ -43,7 +44,7 @@ def event_processor(self, frame, event, arg):
4344 else :
4445 out .write ("%s - %s:%d" % (event , filename , lineno ))
4546 if arg is not None :
46- out .writeline (", %s " % repr (arg ))
47+ out .writeline (f ", { repr (arg )} " )
4748 else :
4849 out .writeline ("" )
4950 pass
0 commit comments