fibonaccios/circuitos/apploader.py

20 lines
402 B
Python
Raw Normal View History

2022-11-29 19:32:41 -08:00
_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