transip-client/transip_client/utils.py
Sonny Bakker 84558826fb
All checks were successful
ci/woodpecker/push/tests Pipeline was successful
Adapter refactor
Allows using different ways to retrieve hosts IP address
2025-05-03 13:51:49 +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)