Skip to content
Snippets Groups Projects
Commit d26698e4 authored by Sebastian Lobinger's avatar Sebastian Lobinger
Browse files

changed SAMSHub.addApp to add appDict to _appList and _apps

The new dictionary consists of the two keys app and urlPrefix.
Value for app is the SAMSApp Object value for urlPrefix is the Alias or
the app.name
parent 263edf4f
Branches
Tags
1 merge request!21Resolve "Apps sollen mit Alias an Hub angemeldet werden können"
......@@ -33,12 +33,13 @@ class SAMSHub:
def addApp(self, app: SAMSApp = None, alias = None):
if not isinstance(app, SAMSApp):
raise TypeError('Argument app has to be a SAMSApp.')
self._apps[app.name] = app
self._appList.append(app)
appDict = {'app': app, 'urlPrefix': (alias or app.name)}
self._apps[app.name] = appDict
self._appList.append(appDict)
if app.name == self._config.get('main_app'):
self._flaskApp.register_blueprint(app.blueprint)
self._flaskApp.register_blueprint(
app.blueprint, url_prefix = '/' + (alias or app.name))
app.blueprint, url_prefix = '/' + appDict['urlPrefix'])
@property
def appKeys(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment