snapshot: capture local workspace state (20251019-132103)
This commit is contained in:
@@ -7,13 +7,18 @@ import os
|
||||
from pathlib import Path
|
||||
from typing import Dict, Optional, List
|
||||
|
||||
# Prefer the packaged app.ipm module, but keep a fallback to the legacy
|
||||
# IPM_DLL folder for development compatibility.
|
||||
# Prefer the packaged app.ipm module, but fall back to the legacy IPM_DLL
|
||||
# folder only if the packaged module cannot be imported. Import the module
|
||||
# object and use getattr to avoid ImportError when optional symbols like
|
||||
# `MockRefifc` are missing.
|
||||
try:
|
||||
from app.ipm.simple_refrig_api import Refifc, MockRefifc # type: ignore
|
||||
import importlib
|
||||
_sr = importlib.import_module('app.ipm.simple_refrig_api')
|
||||
Refifc = getattr(_sr, 'Refifc')
|
||||
MockRefifc = getattr(_sr, 'MockRefifc', None)
|
||||
except Exception:
|
||||
# Fall back to loading from IPM_DLL directory as before. Import the
|
||||
# module and pick attributes if present; older legacy wrappers may not
|
||||
# legacy module and pick attributes if present; older wrappers may not
|
||||
# define MockRefifc.
|
||||
_current_dir = Path(__file__).parent.parent.parent
|
||||
_ipm_dll_dir = _current_dir / "IPM_DLL"
|
||||
|
||||
Reference in New Issue
Block a user