fibonaccios/circuitos/apploader.py
2022-11-30 03:32:41 +00:00

20 lines
402 B
Python

_cache = {}
def get_app(app):
try:
return _cache[app]
except KeyError:
try:
module = __import__(f'/bin/{app}')
except AttributeError:
raise AppNotFound(app)
try:
app_class = module.get_app_class(App)
except AttributeError:
raise InvalidApp(app)
_cache[app] = app_class
return app_class