Compare commits

...

3 Commits

Author SHA1 Message Date
Ruben P
31c78a4aaa Merge d190a60ff7 into a929c6983d 2024-06-29 07:57:05 +02:00
Beans Baxter
a929c6983d refactor: don't check spoolman version if not installed (#487) 2024-06-28 23:07:20 +02:00
Ruben P
d190a60ff7 add an option to terminate or not subprocess
default is true (same behavior as now)
2022-08-29 23:17:51 +02:00
2 changed files with 7 additions and 6 deletions

View File

@@ -18,6 +18,7 @@ class ShellCommand:
self.command = shlex.split(cmd)
self.timeout = config.getfloat('timeout', 2., above=0.)
self.verbose = config.getboolean('verbose', True)
self.terminate = config.getboolean('terminate', True)
self.proc_fd = None
self.partial_output = ""
self.gcode.register_mux_command(
@@ -68,7 +69,7 @@ class ShellCommand:
if proc.poll() is not None:
complete = True
break
if not complete:
if not complete and self.terminate:
proc.terminate()
if self.verbose:
if self.partial_output:

View File

@@ -247,16 +247,16 @@ function get_spoolman_status() {
}
function get_local_spoolman_version() {
[[ ! -d "${SPOOLMAN_DIR}" ]] && return
local version
if [[ -d "${SPOOLMAN_DIR}" ]]; then
version=$(grep -o '"version":\s*"[^"]*' "${SPOOLMAN_DIR}"/release_info.json | cut -d'"' -f4)
else
version=""
fi
version=$(grep -o '"version":\s*"[^"]*' "${SPOOLMAN_DIR}"/release_info.json | cut -d'"' -f4)
echo "${version}"
}
function get_remote_spoolman_version() {
[[ ! -d "${SPOOLMAN_DIR}" ]] && return
local version
version=$(curl -s "${SPOOLMAN_REPO}" | grep -o '"tag_name":\s*"v[^"]*"' | cut -d'"' -f4)
echo "${version}"