remove stale code
This commit is contained in:
@@ -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 []
|
||||
|
||||
|
||||
@@ -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():
|
||||
|
||||
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user