summaryrefslogtreecommitdiff
path: root/src/home/relay/__init__.py
blob: 406403d9ef58f97e4fee4ad3c38b5a84eec4c6ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import importlib

__all__ = ['RelayClient', 'RelayServer']


def __getattr__(name):
    _map = {
        'RelayClient': '.sunxi_h3_client',
        'RelayServer': '.sunxi_h3_server'
    }

    if name in __all__:
        module = importlib.import_module(_map[name], __name__)
        return getattr(module, name)

    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")