~ubuntuone-hackers/conn-check/trunk

« back to all changes in this revision

Viewing changes to conn_check/patterns.py

[r=wesmason] Add firewall rule yaml output options

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import re
2
2
 
 
3
 
3
4
class Pattern(object):
4
5
    """Abstract base class for patterns used to select subsets of checks."""
5
6
 
21
22
 
22
23
    def prefix_matches(self, partial_name):
23
24
        """Return True if the partial name (a prefix) is a potential match."""
24
 
        raise NotImplementedError("%r.prefix_matches not implemented" %
25
 
                                  type(self))
 
25
        raise NotImplementedError("{}.prefix_matches not "
 
26
                                  "implemented".format(type(self)))
26
27
 
27
28
    def matches(self, name):
28
29
        """Return True if the given name matches."""
29
 
        raise NotImplementedError("%r.match not implemented" %
30
 
                                  type(self))
 
30
        raise NotImplementedError("{}.match not "
 
31
                                  "implemented".format(type(self)))
31
32
 
32
33
 
33
34
class FailedPattern(Pattern):