diff --git a/backend/nodes/helpers.py b/backend/nodes/helpers.py index 70d480b..4a15a68 100644 --- a/backend/nodes/helpers.py +++ b/backend/nodes/helpers.py @@ -11,7 +11,7 @@ from typing import Callable import numpy as np -from backend.runtime_paths import demo_dir, input_dir, output_dir +from backend.runtime_paths import demo_dir # --------------------------------------------------------------------------- # Scalar payload helpers (from display.py) @@ -522,8 +522,6 @@ def _rasterize_mask(width, height, strokes, default_pen_size): # --------------------------------------------------------------------------- DEMO_DIR = demo_dir() -INPUT_DIR = input_dir() -OUTPUT_DIR = output_dir() _MAX_SAVE_FIELDS = 8 @@ -532,21 +530,8 @@ from backend.importers import all_extensions, get_importer _PATH_COMPATIBLE_EXTENSIONS = all_extensions() -def _resolve_path(filepath: str): - path = Path(filepath) - if path.is_absolute(): - return path - candidate = INPUT_DIR / filepath - if candidate.exists(): - return candidate - candidate = DEMO_DIR / filepath - if candidate.exists(): - return candidate - return INPUT_DIR / filepath - - def list_channels(filepath: str) -> list[dict]: - path = _resolve_path(filepath) + path = Path(filepath) if not path.exists(): return [{"name": "field", "type": "DATA_FIELD"}] @@ -564,7 +549,7 @@ def list_channels(filepath: str) -> list[dict]: def list_folder_paths(folderpath: str) -> list[dict]: - path = _resolve_path(folderpath) + path = Path(folderpath) if not path.exists() or not path.is_dir(): return [] diff --git a/backend/nodes/image.py b/backend/nodes/image.py index 1ff610e..59bd7bd 100644 --- a/backend/nodes/image.py +++ b/backend/nodes/image.py @@ -5,7 +5,6 @@ from pathlib import Path from backend.node_registry import register_node from backend.execution_context import emit_warning from backend.data_types import COLORMAPS, DataField, resolve_colormap_input -from backend.nodes.helpers import _resolve_path from backend.importers import get_importer, calibrated_extensions @@ -44,7 +43,7 @@ class Image: selected_path = str(path).strip() if path is not None else str(filename).strip() if not selected_path: raise ValueError("No file selected — use Browse to pick a file.") - path_obj = _resolve_path(selected_path) + path_obj = Path(selected_path) if not path_obj.exists(): raise FileNotFoundError(f"File not found: {path_obj}") if path_obj.is_dir(): diff --git a/backend/nodes/note.py b/backend/nodes/note.py index 18ac241..f2a5444 100644 --- a/backend/nodes/note.py +++ b/backend/nodes/note.py @@ -2,9 +2,11 @@ from __future__ import annotations import re +from pathlib import Path + from backend.node_registry import register_node from backend.data_types import DataTable -from backend.nodes.helpers import _resolve_path, _import_ibw_loader +from backend.nodes.helpers import _import_ibw_loader def _parse_ibw_note(note_bytes: bytes) -> list[dict]: @@ -57,7 +59,7 @@ class Note: selected = str(path).strip() if path is not None else str(filename).strip() if not selected: raise ValueError("No file selected.") - path_obj = _resolve_path(selected) + path_obj = Path(selected) if not path_obj.exists(): raise FileNotFoundError(f"File not found: {path_obj}") if path_obj.suffix.lower() != ".ibw": diff --git a/backend/runtime_paths.py b/backend/runtime_paths.py index 1ac0817..fa7b4cf 100644 --- a/backend/runtime_paths.py +++ b/backend/runtime_paths.py @@ -54,14 +54,6 @@ def demo_dir() -> Path: return project_root() / "demo" -def input_dir() -> Path: - return app_data_dir() / "input" - - -def output_dir() -> Path: - return app_data_dir() / "output" - - def plugins_dir() -> Path: return app_data_dir() / "plugins" @@ -84,7 +76,5 @@ def plugins_enabled(*, native: bool) -> bool: def ensure_runtime_dirs(*, with_plugins: bool = False) -> None: - input_dir().mkdir(parents=True, exist_ok=True) - output_dir().mkdir(parents=True, exist_ok=True) if with_plugins: plugins_dir().mkdir(parents=True, exist_ok=True) diff --git a/frontend/public/default-workflow.png b/frontend/public/default-workflow.png index 2cb7bdb..0252825 100644 Binary files a/frontend/public/default-workflow.png and b/frontend/public/default-workflow.png differ