diff options
-rw-r--r-- | cherrypy/config.py | 4 | ||||
-rw-r--r-- | cherrypy/lib/covercp.py | 40 |
2 files changed, 22 insertions, 22 deletions
diff --git a/cherrypy/config.py b/cherrypy/config.py index 22d24557..6b6069b0 100644 --- a/cherrypy/config.py +++ b/cherrypy/config.py @@ -62,7 +62,7 @@ def reset(useDefaults=True): configMap["global"] = defaultGlobal.copy() reset() -def update(updateMap=None, file=None, override = False): +def update(updateMap=None, file=None, override = True): """ Update the configMap from a dictionary or a config file. If override is True then the update will not modify values already defined in the configMap. @@ -75,7 +75,7 @@ def update(updateMap=None, file=None, override = False): valueMap = {section: valueMap} section = 'global' sectionMap = configMap.setdefault(section, {}) - if not override: + if override: sectionMap.update(valueMap) else: for key, value in valueMap.iteritems(): 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 |