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

created example_App.py add ExampleApp module

parent 262d0748
No related branches found
No related tags found
1 merge request!10Resolve "Example App schreiben"
File moved
#from test_app import hub
#hub.app.run(debug = True)
from importlib import import_module
import_module('foo')
\ No newline at end of file
from .ExampleApp import hub
hub.flaskApp.run()
\ No newline at end of file
from ..sams_classes import SAMSHub
import yaml
with open('config/config.yaml', 'r') as f:
hubConf = yaml.load(f.read())
hub = SAMSHub(config=hubConf.get(
'ExampleApp',
{ 'default_language': 'en', 'main_app': 'Main'}
))
hub.flaskApp.config.update(hubConf.get('flask', {}))
for appName in hubConf.get('apps', []):
with open('../' + appName + '/manifest.yaml') as f:
manifest = yaml.load(f.read())
# it is possible for the exampleApp to manipulate the manifest if needed
# manifest.update({}) <-- or whatever
""" TODO: loadDictFromYAMLFiles """
hub.addApp(SAMSApp(name = appName, manifest = manifest, langDict = langDict))
\ No newline at end of file
from ExampleApp import hub
from ExampleApp import search_yaml_files
hub.flaskApp.run()
# hub.flaskApp.run()
search_yaml_files('./ExampleApp/config/')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment