Merge pull request #22392 from knipknap/fix-test-uses-user-data

CAM: fix: CAM tests use files from user asset dir
This commit is contained in:
sliptonic
2025-07-28 11:08:50 -05:00
committed by GitHub
3 changed files with 6 additions and 1 deletions

View File

@@ -108,6 +108,10 @@ class CAMWorkbench(Workbench):
from Path.Tool.toolbit.ui import cmd as PathToolBitCmd
from Path.Tool.library.ui import cmd as PathToolBitLibraryCmd
from Path.Tool.camassets import cam_assets
cam_assets.setup()
from PySide.QtCore import QT_TRANSLATE_NOOP
import PathCommands

View File

@@ -128,6 +128,8 @@ def getAssetPath() -> pathlib.Path:
def setAssetPath(path: pathlib.Path):
assert path.is_dir(), f"Cannot put a non-initialized asset directory into preferences: {path}"
if str(path) == str(getAssetPath()):
return
pref = tool_preferences()
pref.SetString(ToolPath, str(path))
_emit_change(ToolGroup, ToolPath, path)

View File

@@ -18,7 +18,6 @@ cam_assets.register_asset(ToolBitShape, DummyAssetSerializer)
cam_assets.register_asset(ToolBitShapePngIcon, DummyAssetSerializer)
cam_assets.register_asset(ToolBitShapeSvgIcon, DummyAssetSerializer)
cam_assets.register_asset(Machine, DummyAssetSerializer)
cam_assets.setup()
# For backward compatibility with files saved before the toolbit rename
# This makes the Path.Tool.toolbit.base module available as Path.Tool.Bit.