diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-03-12 07:54:07 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-03-12 07:54:07 -0400 |
commit | 1ebf4acdb2f4d31d5269a9a6a60d44d86b26f910 (patch) | |
tree | bd3b88e18b8bb1144e50148675b9f2a88ddb0a68 /coverage/control.py | |
parent | 7a1f7dd92c18c312cac37fd07358ddfa1d36d5ca (diff) | |
download | python-coveragepy-1ebf4acdb2f4d31d5269a9a6a60d44d86b26f910.tar.gz |
Convert the last of the document-style comments to a docstring.
Diffstat (limited to 'coverage/control.py')
-rw-r--r-- | coverage/control.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/coverage/control.py b/coverage/control.py index 42931c6..8a38fff 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -137,14 +137,18 @@ class coverage: self.analysis_cache[code_unit.filename] = result return result - # format_lines(statements, lines). Format a list of line numbers - # for printing by coalescing groups of lines as long as the lines - # represent consecutive statements. This will coalesce even if - # there are gaps between statements, so if statements = - # [1,2,3,4,5,10,11,12,13,14] and lines = [1,2,5,10,11,13,14] then - # format_lines will return "1-2, 5-11, 13-14". - def format_lines(self, statements, lines): + """Nicely format a list of line numbers. + + Format a list of line numbers for printing by coalescing groups of + lines as long as the lines represent consecutive statements. This will + coalesce even if there are gaps between statements. + + For example, if `statements` is [1,2,3,4,5,10,11,12,13,14] and + `lines` is [1,2,5,10,11,13,14] then the result will be "1-2, 5-11, 13-14". + + """ + pairs = [] i = 0 j = 0 |