summaryrefslogtreecommitdiff
path: root/cherrypy/lib/covercp.py
diff options
context:
space:
mode:
Diffstat (limited to 'cherrypy/lib/covercp.py')
-rw-r--r--cherrypy/lib/covercp.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/cherrypy/lib/covercp.py b/cherrypy/lib/covercp.py
index eb264a7c..1800b8e2 100644
--- a/cherrypy/lib/covercp.py
+++ b/cherrypy/lib/covercp.py
@@ -74,19 +74,19 @@ class CoverStats(object):
def menu(self):
yield "<h2>CherryPy Coverage</h2>"
- yield "<p>Click on one of the modules below to see coverage analysis.</p>"
- coverage.get_ready()
- runs = [os.path.split(x) for x in coverage.cexecuted.keys()]
- runs.sort()
- if runs:
- base = ""
- for x in runs:
- newbase, fname = x
- if base != newbase:
- base = newbase
- yield "<h3>%s</h3>\n" % newbase
- yield ("<a href='report?name=%s' target='main'>%s</a><br />\n"
- % (os.path.join(newbase, fname), fname))
+ yield "<p>Click on one of the modules below to see coverage analysis.</p>"
+ coverage.get_ready()
+ runs = [os.path.split(x) for x in coverage.cexecuted.keys()]
+ runs.sort()
+ if runs:
+ base = ""
+ for x in runs:
+ newbase, fname = x
+ if base != newbase:
+ base = newbase
+ yield "<h3>%s</h3>\n" % newbase
+ yield ("<a href='report?name=%s' target='main'>%s</a><br />\n"
+ % (os.path.join(newbase, fname), fname))
menu.exposed = True
def annotated_file(self, filename, statements, excluded, missing):
@@ -133,16 +133,16 @@ class CoverStats(object):
return result
def report(self, name):
- import cherrypy
- cherrypy.response.headerMap['Content-Type'] = 'text/plain'
- filename, statements, excluded, missing, _ = coverage.analysis2(name)
- return self.annotated_file(filename, statements, excluded, missing)
+ import cherrypy
+ cherrypy.response.headerMap['Content-Type'] = 'text/plain'
+ filename, statements, excluded, missing, _ = coverage.analysis2(name)
+ return self.annotated_file(filename, statements, excluded, missing)
report.exposed = True
-
+
def serve(path=localFile, port=8080):
- if coverage is None:
- raise ImportError("<p>The coverage module could not be imported.</p>")
+ if coverage is None:
+ raise ImportError("<p>The coverage module could not be imported.</p>")
coverage.cache_default = path
import cherrypy