Another import bug. This time if --version doesn't return a patch number.
This commit is contained in:
@@ -89,6 +89,7 @@ class PathWorkbench(Workbench):
|
||||
|
||||
import PathCommands
|
||||
import subprocess
|
||||
from packaging.version import Version, parse
|
||||
|
||||
PathGuiInit.Startup()
|
||||
|
||||
@@ -162,11 +163,11 @@ class PathWorkbench(Workbench):
|
||||
r = subprocess.run(
|
||||
["camotics", "--version"], capture_output=True, text=True
|
||||
).stderr.strip()
|
||||
major, minor, patch = r.split(".")
|
||||
if int(major) >= 1 and int(minor) >= 2 and int(patch) >= 2:
|
||||
# subprocess.call(["camsim", "-v"])
|
||||
v = parse(r)
|
||||
|
||||
if v >= Version("1.2.2"):
|
||||
toolcmdlist.append("Path_Camotics")
|
||||
except FileNotFoundError:
|
||||
except (FileNotFoundError, ModuleNotFoundError):
|
||||
pass
|
||||
|
||||
try:
|
||||
|
||||
@@ -78,14 +78,18 @@ def Startup():
|
||||
from PathScripts import PathUtilsGui
|
||||
from PathScripts import PathVcarveGui
|
||||
|
||||
from packaging.version import Version, parse
|
||||
|
||||
# If camotics is installed and current enough, import the GUI
|
||||
try:
|
||||
import camotics
|
||||
|
||||
r = subprocess.run(
|
||||
["camotics", "--version"], capture_output=True, text=True
|
||||
).stderr.strip()
|
||||
major, minor, patch = r.split(".")
|
||||
if int(major) >= 1 and int(minor) >= 2 and int(patch) >= 2:
|
||||
|
||||
v = parse(r)
|
||||
if v >= Version("1.2.2"):
|
||||
from PathScripts import PathCamoticsGui
|
||||
except (FileNotFoundError, ModuleNotFoundError):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user