Find executors for matching platform/executor names Only the first instance of a matching executor will be returned, as there should not be multiple executors matching a single platform/executor name pair. :param names: Executors to search. ex: ['psh', 'cmd'
(self, names, platform)
| 126 | return self._executor_map.get(self._make_executor_map_key(name, platform)) |
| 127 | |
| 128 | def find_executors(self, names, platform): |
| 129 | """Find executors for matching platform/executor names |
| 130 | |
| 131 | Only the first instance of a matching executor will be returned, |
| 132 | as there should not be multiple executors matching a single |
| 133 | platform/executor name pair. |
| 134 | |
| 135 | :param names: Executors to search. ex: ['psh', 'cmd'] |
| 136 | :type names: list(str) |
| 137 | :param platform: Platform to search. ex: windows |
| 138 | :type platform: str |
| 139 | :return: List of executors ordered based on ordering of `names` |
| 140 | :rtype: list(Executor) |
| 141 | """ |
| 142 | executors = [] |
| 143 | seen_names = set() |
| 144 | for name in names: |
| 145 | if name in seen_names: |
| 146 | continue |
| 147 | seen_names.add(name) |
| 148 | |
| 149 | executor = self.find_executor(name, platform) |
| 150 | if executor: |
| 151 | executors.append(executor) |
| 152 | |
| 153 | return executors |
| 154 | |
| 155 | def add_executor(self, executor): |
| 156 | """Add executor to map |