diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-06 22:09:26 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-09-06 22:09:26 -0400 |
commit | c97414a92b94d4c2f57a92fc5899f3624d8fb028 (patch) | |
tree | 2707182eefc27a6367d974f2f71ff61e10b6f197 /coverage/files.py | |
parent | 4512e2c23ecd31b2b4b19740d915ceeeab2231d3 (diff) | |
download | python-coveragepy-git-c97414a92b94d4c2f57a92fc5899f3624d8fb028.tar.gz |
Give the matchers a way to get info out of them.
Diffstat (limited to 'coverage/files.py')
-rw-r--r-- | coverage/files.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/coverage/files.py b/coverage/files.py index 4c55151e..8d154c6f 100644 --- a/coverage/files.py +++ b/coverage/files.py @@ -144,6 +144,10 @@ class TreeMatcher(object): def __repr__(self): return "<TreeMatcher %r>" % self.dirs + def info(self): + """A list of strings for displaying when dumping state.""" + return self.dirs + def add(self, directory): """Add another directory to the list we match for.""" self.dirs.append(directory) @@ -169,6 +173,10 @@ class FnmatchMatcher(object): def __repr__(self): return "<FnmatchMatcher %r>" % self.pats + def info(self): + """A list of strings for displaying when dumping state.""" + return self.pats + def match(self, fpath): """Does `fpath` match one of our filename patterns?""" for pat in self.pats: |