summaryrefslogtreecommitdiff
path: root/coverage/pytracer.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-10-19 11:51:26 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-10-19 11:51:26 -0400
commitcd015c45c278aca757263746ed2e64c46d578ddd (patch)
treeb1e1e0636082dd1d28605048a2f268a11e9555cd /coverage/pytracer.py
parent2150bdc270fa92d56a2fadea4c8d1f76fe6ab531 (diff)
downloadpython-coveragepy-git-cd015c45c278aca757263746ed2e64c46d578ddd.tar.gz
More plugin re-shaping
Diffstat (limited to 'coverage/pytracer.py')
-rw-r--r--coverage/pytracer.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/coverage/pytracer.py b/coverage/pytracer.py
index 7563ae11..84071bb1 100644
--- a/coverage/pytracer.py
+++ b/coverage/pytracer.py
@@ -33,7 +33,7 @@ class PyTracer(object):
# The threading module to use, if any.
self.threading = None
- self.plugin = []
+ self.file_tracer = []
self.cur_file_dict = []
self.last_line = [0]
@@ -62,7 +62,7 @@ class PyTracer(object):
if self.arcs and self.cur_file_dict:
pair = (self.last_line, -self.last_exc_firstlineno)
self.cur_file_dict[pair] = None
- self.plugin, self.cur_file_dict, self.last_line = (
+ self.file_tracer, self.cur_file_dict, self.last_line = (
self.data_stack.pop()
)
self.last_exc_back = None
@@ -71,7 +71,7 @@ class PyTracer(object):
# Entering a new function context. Decide if we should trace
# in this file.
self.data_stack.append(
- (self.plugin, self.cur_file_dict, self.last_line)
+ (self.file_tracer, self.cur_file_dict, self.last_line)
)
filename = frame.f_code.co_filename
disp = self.should_trace_cache.get(filename)
@@ -79,12 +79,12 @@ class PyTracer(object):
disp = self.should_trace(filename, frame)
self.should_trace_cache[filename] = disp
- self.plugin = None
+ self.file_tracer = None
self.cur_file_dict = None
if disp.trace:
tracename = disp.source_filename
- if disp.plugin:
- dyn_func = disp.plugin.dynamic_source_file_name()
+ if disp.file_tracer:
+ dyn_func = disp.file_tracer.dynamic_source_file_name()
if dyn_func:
tracename = dyn_func(tracename, frame)
if tracename:
@@ -95,17 +95,17 @@ class PyTracer(object):
if tracename:
if tracename not in self.data:
self.data[tracename] = {}
- if disp.plugin:
- self.plugin_data[tracename] = disp.plugin.__name__
+ if disp.file_tracer:
+ self.plugin_data[tracename] = disp.file_tracer.plugin_name
self.cur_file_dict = self.data[tracename]
- self.plugin = disp.plugin
+ self.file_tracer = disp.file_tracer
# Set the last_line to -1 because the next arc will be entering a
# code block, indicated by (-1, n).
self.last_line = -1
elif event == 'line':
# Record an executed line.
- if self.plugin:
- lineno_from, lineno_to = self.plugin.line_number_range(frame)
+ if self.file_tracer:
+ lineno_from, lineno_to = self.file_tracer.line_number_range(frame)
else:
lineno_from, lineno_to = frame.f_lineno, frame.f_lineno
if lineno_from != -1:
@@ -123,7 +123,7 @@ class PyTracer(object):
first = frame.f_code.co_firstlineno
self.cur_file_dict[(self.last_line, -first)] = None
# Leaving this function, pop the filename stack.
- self.plugin, self.cur_file_dict, self.last_line = (
+ self.file_tracer, self.cur_file_dict, self.last_line = (
self.data_stack.pop()
)
elif event == 'exception':