(self, pattern, description=None)
| 89 | |
| 90 | @final |
| 91 | def add_pattern(self, pattern, description=None): |
| 92 | try: |
| 93 | compiled = re.compile(pattern) |
| 94 | if description: |
| 95 | self.patterns.append(Pattern(compiled, description=description)) |
| 96 | else: |
| 97 | self.patterns.append(Pattern(compiled)) |
| 98 | except re.error: |
| 99 | fail('Error: The pattern "' + pattern + '" in the plugin "' + self.name + '" is invalid regex.') |
| 100 | |
| 101 | @final |
| 102 | def info(self, msg, verbosity=0): |