From 2afd49426c2f284ac3579edfec6778027f8fd710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20De=20Keersmaeker?= <francois.dekeersmaeker@uclouvain.be> Date: Wed, 10 Jul 2024 13:58:11 +0200 Subject: [PATCH] Updates for submodule usage --- Protocol.py | 5 +++-- __init__.py | 0 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 __init__.py diff --git a/Protocol.py b/Protocol.py index 53db0cb..183b80e 100644 --- a/Protocol.py +++ b/Protocol.py @@ -2,9 +2,10 @@ from __future__ import annotations from typing import Union import importlib + class Protocol: """ - Generic protocol, inherited by all concrete + Generic protocol, inherited by all concrete protocols. """ @@ -47,7 +48,7 @@ class Protocol: :param protocol_data: Dictionary containing the protocol data. :param device: Dictionary containing the device metadata. """ - module = importlib.import_module(f"{protocol_name}") + module = importlib.import_module(f".{protocol_name}", package="protocols") cls = getattr(module, protocol_name) return cls(protocol_data, device) diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 -- GitLab