23
23
24
24
from tracer import EVENT2SHORT
25
25
26
- from trepan import vprocessor as Mprocessor
26
+ from trepan . vprocessor import Processor
27
27
from trepan .lib import bytecode as Mbytecode
28
28
from trepan import exception as Mexcept
29
29
from trepan .lib import display as Mdisplay
@@ -177,9 +177,8 @@ def print_location(proc_obj):
177
177
remapped_file = None
178
178
source_text = None
179
179
while i_stack >= 0 :
180
- frame_lineno = proc_obj .stack [i_stack ]
180
+ frame , lineno = proc_obj .stack [i_stack ]
181
181
i_stack -= 1
182
- frame , lineno = frame_lineno
183
182
184
183
# # Next check to see that local variable breadcrumb exists and
185
184
# # has the magic dynamic value.
@@ -236,8 +235,9 @@ def print_location(proc_obj):
236
235
# into the corresponding line of the tempfile
237
236
co = proc_obj .curframe .f_code
238
237
tempdir = proc_obj .settings ("tempdir" )
239
- temp_filename , name_for_code = deparse_and_cache (co , proc_obj .errmsg ,
240
- tempdir = tempdir )
238
+ temp_filename , name_for_code = deparse_and_cache (
239
+ co , proc_obj .errmsg , tempdir = tempdir
240
+ )
241
241
lineno = 1
242
242
# _, lineno = pyficache.unmap_file_line(temp_filename, lineno, True)
243
243
if temp_filename :
@@ -257,14 +257,18 @@ def print_location(proc_obj):
257
257
# FIXME: DRY code with version in cmdproc.py print_location
258
258
prefix = osp .basename (temp_name ).split ("." )[0 ]
259
259
fd = tempfile .NamedTemporaryFile (
260
- suffix = ".py" , prefix = prefix , delete = False ,
260
+ suffix = ".py" ,
261
+ prefix = prefix ,
262
+ delete = False ,
261
263
dir = proc_obj .settings ("tempdir" ),
262
264
)
263
265
with fd :
264
266
fd .write ("" .join (lines ))
265
267
remapped_file = fd .name
266
268
pyficache .remap_file (remapped_file , filename )
267
269
fd .close ()
270
+ intf_obj .msg ("remapped file %s to %s" % (filename , remapped_file ))
271
+
268
272
pass
269
273
line = linecache .getline (filename , lineno , proc_obj .curframe .f_globals )
270
274
pass
@@ -305,10 +309,10 @@ def print_location(proc_obj):
305
309
}
306
310
307
311
308
- class CommandProcessor (Mprocessor . Processor ):
312
+ class CommandProcessor (Processor ):
309
313
def __init__ (self , core_obj , opts = None ):
310
314
get_option = lambda key : Mmisc .option_set (opts , key , DEFAULT_PROC_OPTS )
311
- Mprocessor . Processor .__init__ (self , core_obj )
315
+ Processor .__init__ (self , core_obj )
312
316
313
317
self .continue_running = False # True if we should leave command loop
314
318
self .event2short = dict (EVENT2SHORT )
0 commit comments