Skip to content
Extraits de code Groupes Projets
Valider 2afd4942 rédigé par François De Keersmaeker's avatar François De Keersmaeker
Parcourir les fichiers

Updates for submodule usage

parent d1b4408f
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -2,9 +2,10 @@ from __future__ import annotations ...@@ -2,9 +2,10 @@ from __future__ import annotations
from typing import Union from typing import Union
import importlib import importlib
class Protocol: class Protocol:
""" """
Generic protocol, inherited by all concrete Generic protocol, inherited by all concrete protocols.
""" """
...@@ -47,7 +48,7 @@ class Protocol: ...@@ -47,7 +48,7 @@ class Protocol:
:param protocol_data: Dictionary containing the protocol data. :param protocol_data: Dictionary containing the protocol data.
:param device: Dictionary containing the device metadata. :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) cls = getattr(module, protocol_name)
return cls(protocol_data, device) return cls(protocol_data, device)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter