remote.py 354 B

123456789101112131415
  1. # SPDX-License-Identifier: GPL-2.0
  2. import os
  3. import importlib
  4. _modules = {}
  5. def Remote(kind, args, src_path):
  6. global _modules
  7. if kind not in _modules:
  8. _modules[kind] = importlib.import_module("..remote_" + kind, __name__)
  9. dir_path = os.path.abspath(src_path + "/../")
  10. return getattr(_modules[kind], "Remote")(args, dir_path)