summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-06 06:43:22 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-06 06:43:22 -0400
commita0dc2746333b38e280638024a1f4f1c457719690 (patch)
tree41347255e793408b1d77536244fcac5d0255318e
parent501f15ce6c94ea9ca09cad41370d5652d5213841 (diff)
downloadpython-coveragepy-git-a0dc2746333b38e280638024a1f4f1c457719690.tar.gz
Remove an unneeded base class, left over from pre-plugin days
-rw-r--r--TODO.txt1
-rw-r--r--coverage/parser.py21
2 files changed, 4 insertions, 18 deletions
diff --git a/TODO.txt b/TODO.txt
index 1ae74846..5b3d6e07 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -53,6 +53,7 @@ Key:
- build process
- don't publish to nedbat.com any more (but still need the sample html reports)
- don't need .px tooling
+ - write a new nedbat.com/code/coverage page.
- all doc links should point to rtfd
+ Remove code only run on <2.6
+ Change data file to json
diff --git a/coverage/parser.py b/coverage/parser.py
index 2bdd1bc9..497ddeb4 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -17,24 +17,7 @@ from coverage.misc import CoverageException, NoSource, NotPython
from coverage.phystokens import compile_unicode, generate_tokens
-class CodeParser(object):
- """
- Base class for any code parser.
- """
- def translate_lines(self, lines):
- return set(lines)
-
- def translate_arcs(self, arcs):
- return arcs
-
- def exit_counts(self):
- return {}
-
- def arcs(self):
- return []
-
-
-class PythonParser(CodeParser):
+class PythonParser(object):
"""Parse code to find executable lines, excluded lines, etc."""
@contract(text='unicode|None')
@@ -198,9 +181,11 @@ class PythonParser(CodeParser):
return set(self.first_line(l) for l in lines)
def translate_lines(self, lines):
+ """Implement `FileReporter.translate_lines`."""
return self.first_lines(lines)
def translate_arcs(self, arcs):
+ """Implement `FileReporter.translate_arcs`."""
return [
(self.first_line(a), self.first_line(b))
for (a, b) in arcs