diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index f201c04..3851efa 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -3,15 +3,9 @@
-
-
-
-
-
-
@@ -23,7 +17,7 @@
-
+
@@ -66,11 +60,11 @@
-
+
-
-
+
+
@@ -81,7 +75,7 @@
-
+
@@ -112,11 +106,11 @@
-
+
-
-
+
+
@@ -124,6 +118,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -176,16 +180,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -245,7 +239,6 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -550,84 +640,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1133,12 +1145,12 @@
-
+
-
+
@@ -1194,14 +1206,6 @@
-
-
-
-
-
-
-
-
@@ -1558,47 +1562,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1612,14 +1575,6 @@
-
-
-
-
-
-
-
-
@@ -1638,25 +1593,82 @@
-
+
-
-
+
+
-
+
+
+
+
+
+
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/core/controller/plugin_controller.py b/core/controller/plugin_controller.py
index 585b830..d33c94a 100644
--- a/core/controller/plugin_controller.py
+++ b/core/controller/plugin_controller.py
@@ -38,7 +38,7 @@ class PluginController():
data = yaml.load(await resp.text())
return data
- async def load_plugins(self):
+ def load_plugins(self):
for filename in os.listdir("./core/extension"):
@@ -107,7 +107,8 @@ class PluginController():
print(self.cbpi.step.types)
if issubclass(clazz, CBPiExtension):
self.c = clazz(self.cbpi)
- self.cbpi.register(self.c, "/dummy")
+ print("D###### DUMMY")
+ #self.cbpi.register(self.c, "/dummy")
def _parse_props(self, cls):
diff --git a/core/craftbeerpi.py b/core/craftbeerpi.py
index 09f5edc..ee6a4e6 100644
--- a/core/craftbeerpi.py
+++ b/core/craftbeerpi.py
@@ -62,10 +62,12 @@ class CraftBeerPi():
self.kettle = KettleController(self)
self.step = StepController(self)
self.notification = NotificationController(self)
- self.dummy = MyComp(self)
+ #self.dummy = MyComp(self)
+
self.login = Login(self)
+ self.plugin.load_plugins()
self.register_events(self.ws)
@@ -127,7 +129,7 @@ class CraftBeerPi():
for method in [getattr(obj, f) for f in dir(obj) if callable(getattr(obj, f)) and hasattr(getattr(obj, f), "ws")]:
self.ws.add_callback(method, method.__getattribute__("key"))
- def register(self, obj, url_prefix=None):
+ def register(self, obj, url_prefix=None, static=None):
'''
This method parses the provided object
@@ -136,13 +138,13 @@ class CraftBeerPi():
:param url_prefix: that prefix for HTTP Endpoints
:return: None
'''
- self.register_http_endpoints(obj, url_prefix)
+ self.register_http_endpoints(obj, url_prefix, static)
self.register_events(obj)
self.register_ws(obj)
self.register_background_task(obj)
self.register_on_startup(obj)
- def register_http_endpoints(self, obj, url_prefix=None):
+ def register_http_endpoints(self, obj, url_prefix=None, static=None):
'''
This method parses the provided object for @request_mapping decorator
@@ -178,10 +180,14 @@ class CraftBeerPi():
switcher[http_method]()
+
+
if url_prefix is not None:
print("Prefx", url_prefix)
sub = web.Application()
sub.add_routes(routes)
+ if static is not None:
+ sub.add_routes([web.static('/static', static, show_index=True)])
self.app.add_subapp(url_prefix, sub)
else:
self.app.add_routes(routes)
@@ -247,7 +253,8 @@ class CraftBeerPi():
async def load_plugins(app):
#await PluginController.load_plugin_list()
- await self.plugin.load_plugins()
+ #self.plugin.load_plugins()
+ pass
async def call_initializer(app):
diff --git a/core/extension/comp/__init__.py b/core/extension/comp/__init__.py
index 7c589ce..345d4d5 100644
--- a/core/extension/comp/__init__.py
+++ b/core/extension/comp/__init__.py
@@ -23,8 +23,7 @@ class MyComp(CBPiExtension, CRUDController, HttpAPI):
'''
self.cbpi = cbpi
# register for bus events
- self.cbpi.register(self, "/dummy")
-
+ self.cbpi.register(self, "/dummy", static="./core/extension/comp/static")
@on_event(topic="actor/#")
@@ -48,5 +47,5 @@ def setup(cbpi):
:return:
'''
# regsiter the component to the core
- #cbpi.plugin.register("MyComp", MyComp)
+ cbpi.plugin.register("MyComp", MyComp)
pass
\ No newline at end of file
diff --git a/core/extension/comp/static/index.html b/core/extension/comp/static/index.html
new file mode 100644
index 0000000..ab1afad
--- /dev/null
+++ b/core/extension/comp/static/index.html
@@ -0,0 +1 @@
+HALLO WELT INDEX
\ No newline at end of file
diff --git a/craftbeerpi.db b/craftbeerpi.db
index b8ae745..97baeb7 100644
Binary files a/craftbeerpi.db and b/craftbeerpi.db differ