MCPcopy Create free account
hub / github.com/StackStorm/st2 / read

Method read

st2client/st2client/utils/interactive.py:332–353  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

330 )
331
332 def read(self):
333 results = []
334 properties = self.spec.get("items", {}).get("properties", {})
335 message = (
336 '~~~ Would you like to add another item to "%s" array / list?' % self.name
337 )
338
339 is_continue = True
340 index = 0
341 while is_continue:
342 prefix = "{name}[{index}].".format(name=self.name, index=index)
343 results.append(
344 InteractiveForm(
345 properties, prefix=prefix, reraise=True
346 ).initiate_dialog()
347 )
348
349 index += 1
350 if Question(message, {"default": "y"}).read() != "y":
351 is_continue = False
352
353 return results
354
355
356class ArrayEnumReader(EnumReader):

Callers 1

Calls 6

InteractiveFormClass · 0.85
QuestionClass · 0.85
initiate_dialogMethod · 0.80
getMethod · 0.45
formatMethod · 0.45
readMethod · 0.45

Tested by 1