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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user