ActionPrompts: More flexibility for selection_command

Allow users to control how and where the choice is inserted into the response by explicitly including "{choice}" in the selection_command
This commit is contained in:
Florian Heilmann authored and GitHub committed 2019-09-25 22:09:20 +02:00
1 parent 5c54f16ece
commit 2e6ee57162
1 file changed
+4 -1
@@ -207,7 +207,10 @@ class ActionCommandPromptPlugin(octoprint.plugin.AssetPlugin,
return
self._close_prompt()
self._printer.commands(["{command} S{choice}".format(command=self._command,
if "{choice}" in self._command:
self._printer.commands([self._command.format(choice=choice)])
else:
self._printer.commands(["{command} S{choice}".format(command=self._command,
choice=choice)])