MCPcopy
hub / github.com/apache/caldera / find_executors

Method find_executors

app/objects/c_ability.py:128–153  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 6

capabilitiesMethod · 0.80
taskMethod · 0.80
_check_reason_skippedMethod · 0.80

Calls 2

find_executorMethod · 0.95
setFunction · 0.85