From c97414a92b94d4c2f57a92fc5899f3624d8fb028 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Fri, 6 Sep 2013 22:09:26 -0400 Subject: Give the matchers a way to get info out of them. --- coverage/files.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'coverage/files.py') 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 "" % 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 "" % 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: -- cgit v1.2.1