Skip to content

Commit

Permalink
fix bug pull request and remove command.getOutput (compatibility with…
Browse files Browse the repository at this point in the history
… last python
  • Loading branch information
devildant committed Aug 11, 2019
1 parent 4861648 commit 29b6e01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions octoprint_shutdownprinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from octoprint.events import eventManager, Events
from flask import make_response
import time
import commands

class shutdownprinterPlugin(octoprint.plugin.SettingsPlugin,
octoprint.plugin.AssetPlugin,
Expand Down Expand Up @@ -288,8 +287,9 @@ def _shutdown_printer_API_CMD(self, mode):

def _extraCommand(self):
if self.extraCommand != "":
mCmdFound = commands.getoutput(self.extraCommand)
self._logger.info("response extraCommand: %s" % mCmdFound)
process = subprocess.Popen(mCmdFound, shell=True, stdin = None, stdout=subprocess.PIPE)
self.extraCommand = process.communicate()
self._logger.info("response extraCommand: %s" % mCmdFound.rstrip().strip())

def _shutdown_printer_by_API(self):
url = "http://127.0.0.1:" + str(self.api_plugin_port) + "/api/plugin/" + self.api_plugin_name
Expand Down
2 changes: 1 addition & 1 deletion octoprint_shutdownprinter/static/js/shutdownprinter.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ $(function() {
]
self.listOffHTTPMethode = [
{"id" : "#shutdownprinter_api_custom_GET"},
{"id" : "#shutdownprinter_api_custom_POST"}
{"id" : "#shutdownprinter_api_custom_POST"},
{"id" : "#shutdownprinter_api_custom_PUT"}
]
self.eventChangeCheckToRadio("#shutdownprinter_mode_shutdown_gcode", self.listOffMode);
Expand Down

0 comments on commit 29b6e01

Please sign in to comment.