Skip to content

Commit 9da157c

Browse files
committed
Align load_directory import style with develop (module-level app.adapter)
1 parent b3e9ac2 commit 9da157c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

server/app/model/provider.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from basyx.aas import model
66
from basyx.aas.model import provider as sdk_provider
77

8+
from app import adapter
89
from app.model import descriptor
910

1011
PathOrIO = Union[Path, IO]
@@ -64,16 +65,14 @@ def load_directory(directory: Union[Path, str]) -> DictDescriptorStore:
6465
:param directory: Path to the directory containing JSON descriptor files
6566
:return: Populated :class:`DictDescriptorStore`
6667
"""
67-
from app.adapter import ServerAASFromJsonDecoder
68-
6968
store = DictDescriptorStore()
7069
directory = Path(directory)
7170

7271
for file in directory.iterdir():
7372
if not file.is_file() or file.suffix.lower() != ".json":
7473
continue
7574
with open(file) as f:
76-
data = json.load(f, cls=ServerAASFromJsonDecoder)
75+
data = json.load(f, cls=adapter.ServerAASFromJsonDecoder)
7776
for key, cls in _DESCRIPTOR_KEY_TO_CLS:
7877
for item in data.get(key, []):
7978
if isinstance(item, cls):

0 commit comments

Comments
 (0)