transip-client/transip_client/utils.py
Sonny Bakker e93d864ae1
Some checks failed
ci/woodpecker/push/tests Pipeline failed
Adapter refactor
Allows using different ways to retrieve hosts IP address
2025-05-03 13:12:13 +02:00

10 lines
283 B
Python

from importlib import import_module
from typing import Type
from transip_client.adapters import Adapter
def import_string(path: str) -> Type[Adapter]:
module_path, class_name = path.rsplit(".", 1)
module = import_module(module_path)
return getattr(module, class_name)