summaryrefslogtreecommitdiff
path: root/cherrypy/lib/covercp.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-06-05 15:53:11 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-06-05 15:53:11 -0400
commit5e1a48fdbfc528f1db95ae38bef145801654124f (patch)
tree34936e842d8b5165444e03a3594e9a9f0ef0afa6 /cherrypy/lib/covercp.py
parentf77bef63b18748e2bbbd66543f8fc06fa6d1c7b3 (diff)
downloadcherrypy-git-5e1a48fdbfc528f1db95ae38bef145801654124f.tar.gz
Use expose decorator throughout the codebase.
Diffstat (limited to 'cherrypy/lib/covercp.py')
-rw-r--r--cherrypy/lib/covercp.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/cherrypy/lib/covercp.py b/cherrypy/lib/covercp.py
index a74ec342..fa4626b2 100644
--- a/cherrypy/lib/covercp.py
+++ b/cherrypy/lib/covercp.py
@@ -23,11 +23,14 @@ it will call ``serve()`` for you.
import re
import sys
import cgi
-from cherrypy._cpcompat import quote_plus
import os
import os.path
localFile = os.path.join(os.path.dirname(__file__), "coverage.cache")
+from cherrypy._cpcompat import quote_plus
+
+import cherrypy
+
the_coverage = None
try:
from coverage import coverage
@@ -290,10 +293,11 @@ class CoverStats(object):
root = os.path.dirname(cherrypy.__file__)
self.root = root
+ @cherrypy.exposed
def index(self):
return TEMPLATE_FRAMESET % self.root.lower()
- index.exposed = True
+ @cherrypy.exposed
def menu(self, base="/", pct="50", showpct="",
exclude=r'python\d\.\d|test|tut\d|tutorial'):
@@ -328,7 +332,6 @@ class CoverStats(object):
yield "</div>"
yield "</body></html>"
- menu.exposed = True
def annotated_file(self, filename, statements, excluded, missing):
source = open(filename, 'r')
@@ -352,6 +355,7 @@ class CoverStats(object):
buffer = []
yield template % (lineno, cgi.escape(line))
+ @cherrypy.exposed
def report(self, name):
filename, statements, excluded, missing, _ = self.coverage.analysis2(
name)
@@ -366,7 +370,6 @@ class CoverStats(object):
yield '</table>'
yield '</body>'
yield '</html>'
- report.exposed = True
def serve(path=localFile, port=8080, root=None):