summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/drivers/net/lib/py/remote.py
blob: b1780b9877225abc7f660d703fac7fa4cd72fa55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# SPDX-License-Identifier: GPL-2.0

import os
import importlib

_modules = {}

def Remote(kind, args, src_path):
    global _modules

    if kind not in _modules:
        _modules[kind] = importlib.import_module("..remote_" + kind, __name__)

    dir_path = os.path.abspath(src_path + "/../")
    return getattr(_modules[kind], "Remote")(args, dir_path)