diff options
Diffstat (limited to 'command.py')
| -rw-r--r-- | command.py | 11 |
1 files changed, 11 insertions, 0 deletions
| @@ -186,6 +186,17 @@ class Command(object): | |||
| 186 | result.sort(key=_getpath) | 186 | result.sort(key=_getpath) |
| 187 | return result | 187 | return result |
| 188 | 188 | ||
| 189 | def FindProjects(self, args): | ||
| 190 | result = [] | ||
| 191 | for project in self.GetProjects(''): | ||
| 192 | for arg in args: | ||
| 193 | pattern = re.compile(r'%s' % arg, re.IGNORECASE) | ||
| 194 | if pattern.search(project.name) or pattern.search(project.relpath): | ||
| 195 | result.append(project) | ||
| 196 | break | ||
| 197 | result.sort(key=lambda project: project.relpath) | ||
| 198 | return result | ||
| 199 | |||
| 189 | # pylint: disable=W0223 | 200 | # pylint: disable=W0223 |
| 190 | # Pylint warns that the `InteractiveCommand` and `PagedCommand` classes do not | 201 | # Pylint warns that the `InteractiveCommand` and `PagedCommand` classes do not |
| 191 | # override method `Execute` which is abstract in `Command`. Since that method | 202 | # override method `Execute` which is abstract in `Command`. Since that method |
