diff options
Diffstat (limited to 'command.py')
| -rw-r--r-- | command.py | 15 |
1 files changed, 13 insertions, 2 deletions
| @@ -136,11 +136,11 @@ class Command(object): | |||
| 136 | 136 | ||
| 137 | groups = mp.config.GetString('manifest.groups') | 137 | groups = mp.config.GetString('manifest.groups') |
| 138 | if not groups: | 138 | if not groups: |
| 139 | groups = 'all,-notdefault,platform-' + platform.system().lower() | 139 | groups = 'default,platform-' + platform.system().lower() |
| 140 | groups = [x for x in re.split(r'[,\s]+', groups) if x] | 140 | groups = [x for x in re.split(r'[,\s]+', groups) if x] |
| 141 | 141 | ||
| 142 | if not args: | 142 | if not args: |
| 143 | all_projects_list = all_projects.values() | 143 | all_projects_list = list(all_projects.values()) |
| 144 | derived_projects = {} | 144 | derived_projects = {} |
| 145 | for project in all_projects_list: | 145 | for project in all_projects_list: |
| 146 | if submodules_ok or project.sync_s: | 146 | if submodules_ok or project.sync_s: |
| @@ -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 | patterns = [re.compile(r'%s' % a, re.IGNORECASE) for a in args] | ||
| 192 | for project in self.GetProjects(''): | ||
| 193 | for pattern in patterns: | ||
| 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 |
