native-ui/native_ui/__init__.py

20 lines
448 B
Python
Raw Normal View History

2022-07-30 21:03:15 +00:00
from . import abstract
import importlib
native = abstract
runtime_platform = None
def set_runtime_platform(platform, *args, **kwargs):
global native
global runtime_platform
try:
native = importlib.import_module(f".{platform.lower()}", "native_ui.impl")
runtime_platform = platform.lower()
native.requirements(*args, **kwargs)
except ImportError:
raise ValueError(f"{platform} not implemented")