From d26698e4462f6d06f1acdcd4c4820644c50a084b Mon Sep 17 00:00:00 2001 From: Sebastian Lobinger <sebastian.lobinger@zib.de> Date: Fri, 28 Jul 2017 12:57:11 +0200 Subject: [PATCH] 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 --- sams_classes/sams_hub.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sams_classes/sams_hub.py b/sams_classes/sams_hub.py index 920428c..e78525f 100644 --- a/sams_classes/sams_hub.py +++ b/sams_classes/sams_hub.py @@ -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): -- GitLab