From 2e6ee5716210488eb20f7c9d8387ab2180e07cb6 Mon Sep 17 00:00:00 2001 From: Florian Heilmann Date: Wed, 25 Sep 2019 22:09:20 +0200 Subject: [PATCH 1/3] 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 --- src/octoprint/plugins/action_command_prompt/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/octoprint/plugins/action_command_prompt/__init__.py b/src/octoprint/plugins/action_command_prompt/__init__.py index dc5f796e8..bfebac31e 100644 --- a/src/octoprint/plugins/action_command_prompt/__init__.py +++ b/src/octoprint/plugins/action_command_prompt/__init__.py @@ -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)]) From 852a2cf157f4632ccb598f4f4bdd7fad9e00b2c9 Mon Sep 17 00:00:00 2001 From: Florian Heilmann Date: Wed, 25 Sep 2019 22:11:11 +0200 Subject: [PATCH 2/3] Fix indentation --- src/octoprint/plugins/action_command_prompt/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/octoprint/plugins/action_command_prompt/__init__.py b/src/octoprint/plugins/action_command_prompt/__init__.py index bfebac31e..ca45ab689 100644 --- a/src/octoprint/plugins/action_command_prompt/__init__.py +++ b/src/octoprint/plugins/action_command_prompt/__init__.py @@ -211,7 +211,7 @@ class ActionCommandPromptPlugin(octoprint.plugin.AssetPlugin, self._printer.commands([self._command.format(choice=choice)]) else: self._printer.commands(["{command} S{choice}".format(command=self._command, - choice=choice)]) + choice=choice)]) __plugin_name__ = "Action Command Prompt Support" From 55980a1c2c2bbf2d9757718a07c2a491f7c856d9 Mon Sep 17 00:00:00 2001 From: Florian Heilmann Date: Wed, 25 Sep 2019 22:12:51 +0200 Subject: [PATCH 3/3] Update AUTHORS.md --- AUTHORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.md b/AUTHORS.md index 38730e8d6..7c5951d33 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -108,6 +108,7 @@ date of first contribution): * [Piotr Usewicz](https://github.com/pusewicz) * [Aliaksei Pilko](https://github.com/aliaksei135) * [Ben Yarmis](https://github.com/byarmis) + * [Florian Heilmann](https://github.com/FHeilmann) OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by [Daid Braam](https://github.com/daid). Parts of its communication layer and