Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Unified Diff: third_party/coverage-3.7.1/coverage/data.py

Issue 225633007: Upgrade to coverage 3.7.1 and have it auto-build itself on first use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: sigh our imports are a mess Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/coverage-3.7.1/coverage/control.py ('k') | third_party/coverage-3.7.1/coverage/debug.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/coverage-3.7.1/coverage/data.py
diff --git a/third_party/coverage-3.6/coverage/data.py b/third_party/coverage-3.7.1/coverage/data.py
similarity index 95%
rename from third_party/coverage-3.6/coverage/data.py
rename to third_party/coverage-3.7.1/coverage/data.py
index c86a77f2f3a6aee460a42a70f137c6f9373686b7..fb88c5b1e638cdd5954c3818a08d000a4ec499eb 100644
--- a/third_party/coverage-3.6/coverage/data.py
+++ b/third_party/coverage-3.7.1/coverage/data.py
@@ -23,15 +23,18 @@ class CoverageData(object):
"""
- def __init__(self, basename=None, collector=None):
+ def __init__(self, basename=None, collector=None, debug=None):
"""Create a CoverageData.
`basename` is the name of the file to use for storing data.
`collector` is a string describing the coverage measurement software.
+ `debug` is a `DebugControl` object for writing debug messages.
+
"""
self.collector = collector or 'unknown'
+ self.debug = debug
self.use_file = True
@@ -121,6 +124,9 @@ class CoverageData(object):
if self.collector:
data['collector'] = self.collector
+ if self.debug and self.debug.should('dataio'):
+ self.debug.write("Writing data to %r" % (filename,))
+
# Write the pickle to the file.
fdata = open(filename, 'wb')
try:
@@ -134,6 +140,8 @@ class CoverageData(object):
def raw_data(self, filename):
"""Return the raw pickled data from `filename`."""
+ if self.debug and self.debug.should('dataio'):
+ self.debug.write("Reading data from %r" % (filename,))
fdata = open(filename, 'rb')
try:
data = pickle.load(fdata)
« no previous file with comments | « third_party/coverage-3.7.1/coverage/control.py ('k') | third_party/coverage-3.7.1/coverage/debug.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698